winex11: Move XdndLeave event handler to event.c.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-04-24 22:36:32 +02:00 committed by Alexandre Julliard
parent e510f8650e
commit ace09cf315
4 changed files with 14 additions and 3 deletions

View File

@ -1920,6 +1920,13 @@ static void handle_xdnd_drop_event( HWND hwnd, XClientMessageEvent *event )
}
static void handle_xdnd_leave_event( HWND hwnd, XClientMessageEvent *event )
{
UINT type = DND_LEAVE_EVENT;
handle_dnd_event( &type );
}
struct client_message_handler
{
int atom; /* protocol atom */
@ -1935,7 +1942,7 @@ static const struct client_message_handler client_messages[] =
{ XATOM_XdndEnter, handle_xdnd_enter_event },
{ XATOM_XdndPosition, handle_xdnd_position_event },
{ XATOM_XdndDrop, handle_xdnd_drop_event },
{ XATOM_XdndLeave, X11DRV_XDND_LeaveEvent }
{ XATOM_XdndLeave, handle_xdnd_leave_event }
};

View File

@ -31,6 +31,7 @@ struct format_entry
enum dnd_event_type
{
DND_DROP_EVENT,
DND_LEAVE_EVENT,
DND_POSITION_EVENT,
};

View File

@ -294,7 +294,6 @@ 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_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN;
extern void handle_dnd_enter_event( struct format_entry *formats, ULONG size ) DECLSPEC_HIDDEN;
extern UINT handle_dnd_event( void *params ) DECLSPEC_HIDDEN;

View File

@ -342,7 +342,7 @@ static DWORD handle_drop_event( struct dnd_drop_event_params *params )
*
* Handle an XdndLeave event.
*/
void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event )
static NTSTATUS handle_leave_event(void)
{
IDropTarget *dropTarget;
@ -362,6 +362,7 @@ void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event )
}
X11DRV_XDND_FreeDragDropOp();
return 0;
}
@ -736,6 +737,9 @@ UINT handle_dnd_event( void *params )
case DND_DROP_EVENT:
return handle_drop_event( params );
case DND_LEAVE_EVENT:
return handle_leave_event();
case DND_POSITION_EVENT:
return handle_position_event( params );