From 7911ab860fa899b176a3e6d27e34b1733b551cd6 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Dec 2009 12:49:19 -0600 Subject: [PATCH 3/3] winex11.drv: Use the old method to delete the desktop window. --- dlls/winex11.drv/event.c | 8 ++++++++ dlls/winex11.drv/window.c | 2 ++ dlls/winex11.drv/x11drv.h | 1 + 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index e8e4522..2c04850 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -516,6 +516,14 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) HMENU hSysMenu; POINT pt; + if (hwnd == GetDesktopWindow()) + { + /* The desktop window does not have a close button that we can + * pretend to click. Therefore, we simply send it a close command. */ + PostMessageW( hwnd, WM_X11DRV_DELETE_WINDOW, 0, 0 ); + return; + } + if (GetClassLongW(hwnd, GCL_STYLE) & CS_NOCLOSE) return; hSysMenu = GetSystemMenu(hwnd, FALSE); if (hSysMenu) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5df7df2..b540685 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2305,6 +2305,8 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { case WM_X11DRV_ACQUIRE_SELECTION: return X11DRV_AcquireClipboard( hwnd ); + case WM_X11DRV_DELETE_WINDOW: + return SendMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 ); case WM_X11DRV_SET_WIN_FORMAT: return set_win_format( hwnd, (XID)wp ); case WM_X11DRV_SET_WIN_REGION: diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 3dd5edf..b89b275 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -701,6 +701,7 @@ extern DWORD EVENT_x11_time_to_win32_time(Time time); enum x11drv_window_messages { WM_X11DRV_ACQUIRE_SELECTION = 0x80001000, + WM_X11DRV_DELETE_WINDOW, WM_X11DRV_SET_WIN_FORMAT, WM_X11DRV_SET_WIN_REGION, WM_X11DRV_RESIZE_DESKTOP -- 1.6.3.3