Commit 8382bf01 authored by Alexandre Julliard's avatar Alexandre Julliard

Added WM_X11DRV_DELETE_WINDOW message to handle close requests so that

we can send the WM_SYSCOMMAND with SendMessage instead of PostMessage. Added missing NONAMELESSUNION define.
parent f7e0f7ca
......@@ -34,7 +34,9 @@
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "wine/winuser16.h"
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
......@@ -48,7 +50,6 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(event);
WINE_DECLARE_DEBUG_CHANNEL(clipboard);
extern BOOL ximInComposeMode;
......@@ -393,7 +394,7 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
* and we are in managed mode. This is to disallow applications from
* being closed by the window manager while in a modal state.
*/
if (IsWindowEnabled(hwnd)) PostMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
if (IsWindowEnabled(hwnd)) PostMessageW( hwnd, WM_X11DRV_DELETE_WINDOW, 0, 0 );
}
else if (protocol == x11drv_atom(WM_TAKE_FOCUS))
{
......@@ -946,6 +947,8 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
case WM_X11DRV_ACQUIRE_SELECTION:
X11DRV_AcquireClipboard( hwnd );
return 0;
case WM_X11DRV_DELETE_WINDOW:
return SendMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
default:
FIXME( "got window msg %x hwnd %p wp %x lp %lx\n", msg, hwnd, wp, lp );
return 0;
......
......@@ -619,7 +619,8 @@ 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_ACQUIRE_SELECTION = 0x80001000,
WM_X11DRV_DELETE_WINDOW
};
/* x11drv private window data */
......
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