Commit 167514ce authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

winex11.drv: Simulate pressing Alt+F4 instead of clicking the caption Close…

winex11.drv: Simulate pressing Alt+F4 instead of clicking the caption Close button when handling the WM_DELETE_WINDOW event.
parent c9fd854e
......@@ -522,7 +522,6 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
if (IsWindowEnabled(hwnd))
{
HMENU hSysMenu;
POINT pt;
if (GetClassLongW(hwnd, GCL_STYLE) & CS_NOCLOSE) return;
hSysMenu = GetSystemMenu(hwnd, FALSE);
......@@ -553,10 +552,12 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
break;
}
}
/* Simulate clicking the caption Close button */
GetCursorPos( &pt );
PostMessageW( hwnd, WM_NCLBUTTONDOWN, HTCLOSE, MAKELPARAM( pt.x, pt.y ) );
PostMessageW( hwnd, WM_LBUTTONUP, HTCLOSE, MAKELPARAM( pt.x, pt.y ) );
/* Simulate pressing Alt+F4 */
keybd_event(VK_MENU, 0, 0, 0);
keybd_event(VK_F4, 0, 0, 0);
keybd_event(VK_F4, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
}
}
else if (protocol == x11drv_atom(WM_TAKE_FOCUS))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment