winex11.drv: WM_SYSCOMMAND/SC_CLOSE should be posted not sent

Dmitry Timoshkov dmitry at codeweavers.com
Thu Jul 26 02:52:43 CDT 2007


Hello,

this patch fixes crash on exit reported in the bug #2918.

In DefWindowProc we already use PostMessage for WM_SYSCOMMAND/SC_CLOSE
in response to Alt+F4.

Changelog:
    winex11.drv: WM_SYSCOMMAND/SC_CLOSE should be posted not sent.

---
 dlls/winex11.drv/event.c  |    4 +---
 dlls/winex11.drv/x11drv.h |    3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 1f9d2a9..3b0cc3a 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -426,7 +426,7 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
                         break;
                 }
             }
-            PostMessageW( hwnd, WM_X11DRV_DELETE_WINDOW, 0, 0 );
+            PostMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
         }
     }
     else if (protocol == x11drv_atom(WM_TAKE_FOCUS))
@@ -955,8 +955,6 @@ LRESULT 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 );
     default:
         FIXME( "got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, wp, lp );
         return 0;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index a778f64..6dd8d3d 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -632,8 +632,7 @@ extern DWORD EVENT_x11_time_to_win32_time(Time time);
 /* X11 driver private messages, must be in the range 0x80001000..0x80001fff */
 enum x11drv_window_messages
 {
-    WM_X11DRV_ACQUIRE_SELECTION = 0x80001000,
-    WM_X11DRV_DELETE_WINDOW
+    WM_X11DRV_ACQUIRE_SELECTION = 0x80001000
 };
 
 /* x11drv private window data */
-- 
1.5.2.3






More information about the wine-patches mailing list