winex11.drv: Simulate pressing Alt+F4 instead of clicking the caption Close button when handling the WM_DELETE_WINDOW event.
Dmitry Timoshkov
dmitry at codeweavers.com
Fri May 28 01:06:14 CDT 2010
This fixes Firefox (bug 20389) which removes all mouse client messages in
its message loop so that they don't have a chance of reaching DefWindowProc.
---
dlls/winex11.drv/event.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index da45fe2..5bb1ecf 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -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))
--
1.7.0.2
More information about the wine-patches
mailing list