This is to avoid a dubious cast from XClientMessageEvent to XEvent in next patch.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winex11.drv/event.c | 20 +++++++++++++------- dlls/winex11.drv/x11drv.h | 8 ++++---- dlls/winex11.drv/xdnd.c | 11 +++++++---- 3 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index a4a6ad8d601..07777952400 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -618,8 +618,10 @@ static void set_focus( Display *display, HWND hwnd, Time time ) /********************************************************************** * handle_manager_message */ -static void handle_manager_message( HWND hwnd, XClientMessageEvent *event ) +static void handle_manager_message( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; + if (hwnd != GetDesktopWindow()) return; if (systray_atom && event->data.l[1] == systray_atom) change_systray_owner( event->display, event->data.l[2] ); @@ -629,8 +631,9 @@ static void handle_manager_message( HWND hwnd, XClientMessageEvent *event ) /********************************************************************** * handle_wm_protocols */ -static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event ) +static void handle_wm_protocols( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; Atom protocol = (Atom)event->data.l[0]; Time event_time = (Time)event->data.l[1];
@@ -1642,8 +1645,10 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) /********************************************************************** * handle_xembed_protocol */ -static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event ) +static void handle_xembed_protocol( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; + switch (event->data.l[1]) { case XEMBED_EMBEDDED_NOTIFY: @@ -1698,8 +1703,9 @@ static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event ) /********************************************************************** * handle_dnd_protocol */ -static void handle_dnd_protocol( HWND hwnd, XClientMessageEvent *event ) +static void handle_dnd_protocol( HWND hwnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; Window root, child; int root_x, root_y, child_x, child_y; unsigned int u; @@ -1718,8 +1724,8 @@ static void handle_dnd_protocol( HWND hwnd, XClientMessageEvent *event )
struct client_message_handler { - int atom; /* protocol atom */ - void (*handler)(HWND, XClientMessageEvent *); /* corresponding handler function */ + int atom; /* protocol atom */ + void (*handler)(HWND, XEvent *); /* corresponding handler function */ };
static const struct client_message_handler client_messages[] = @@ -1755,7 +1761,7 @@ static BOOL X11DRV_ClientMessage( HWND hwnd, XEvent *xev ) { if (event->message_type == X11DRV_Atoms[client_messages[i].atom - FIRST_XATOM]) { - client_messages[i].handler( hwnd, event ); + client_messages[i].handler( hwnd, xev ); return TRUE; } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b0c79e37bb2..9b70f53d382 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -238,10 +238,10 @@ extern BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp, DWORD dwReadLen) DECLSPEC_HIDDEN; extern void IME_SetResultString(LPWSTR lpResult, DWORD dwResultlen) DECLSPEC_HIDDEN;
-extern void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; -extern void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; -extern void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; -extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; +extern void X11DRV_XDND_EnterEvent( HWND hWnd, XEvent *xev ) DECLSPEC_HIDDEN; +extern void X11DRV_XDND_PositionEvent( HWND hWnd, XEvent *xev ) DECLSPEC_HIDDEN; +extern void X11DRV_XDND_DropEvent( HWND hWnd, XEvent *xev ) DECLSPEC_HIDDEN; +extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XEvent *xev ) DECLSPEC_HIDDEN; extern void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, Atom *targets, UINT count, void (*callback)( Atom, UINT, HANDLE )) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index 8dc4a5bce23..117f4de0736 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -192,8 +192,9 @@ static long X11DRV_XDND_DROPEFFECTToXdndAction(DWORD effect) * * Handle an XdndEnter event. */ -void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ) +void X11DRV_XDND_EnterEvent( HWND hWnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; int version; Atom *xdndtypes; unsigned long count = 0; @@ -291,8 +292,9 @@ static HWND window_accepting_files(HWND hwnd) * * Handle an XdndPosition event. */ -void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) +void X11DRV_XDND_PositionEvent( HWND hWnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; XClientMessageEvent e; int accept = 0; /* Assume we're not accepting */ IDropTarget *dropTarget = NULL; @@ -405,8 +407,9 @@ void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) * * Handle an XdndDrop event. */ -void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) +void X11DRV_XDND_DropEvent( HWND hWnd, XEvent *xev ) { + XClientMessageEvent *event = &xev->xclient; XClientMessageEvent e; IDropTarget *dropTarget; DWORD effect = XDNDDropEffect; @@ -499,7 +502,7 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) * * Handle an XdndLeave event. */ -void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) +void X11DRV_XDND_LeaveEvent( HWND hWnd, XEvent *xev ) { IDropTarget *dropTarget;