Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/9128, adding an XFlush call to make sure requests are being actually written out before we stop calling ProcessEvents for a while.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index ca261b7bf3b..35a51c00700 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -544,7 +544,10 @@ BOOL X11DRV_ProcessEvents( DWORD mask ) free_event_data( &prev_event ); XFlush( gdi_display ); if (count) TRACE( "processed %d events\n", count ); - return !check_fd_events( ConnectionNumber( data->display ), POLLIN ); + + if (check_fd_events( ConnectionNumber( data->display ), POLLIN )) return FALSE; + XFlush( data->display ); /* all events have been processed, flush any pending request */ + return TRUE; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 1 - dlls/winex11.drv/window.c | 5 ----- 2 files changed, 6 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 35a51c00700..9deccc2acfc 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -258,7 +258,6 @@ static void xembed_request_focus( Display *display, Window window, DWORD timesta xev.xclient.data.l[4] = 0;
XSendEvent(display, window, False, NoEventMask, &xev); - XFlush( display ); }
/*********************************************************************** diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 2e6f13eec53..1e006324a54 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1333,8 +1333,6 @@ static void window_set_net_wm_state( struct x11drv_win_data *data, UINT new_stat SubstructureRedirectMask | SubstructureNotifyMask, &xev ); } } - - XFlush( data->display ); }
static void window_set_config( struct x11drv_win_data *data, RECT rect, BOOL above ) @@ -1582,8 +1580,6 @@ static void window_set_wm_state( struct x11drv_win_data *data, UINT new_state, B
/* override redirect windows won't receive WM_STATE property changes */ if (!data->managed) data->wm_state_serial = 0; - - XFlush( data->display ); }
static void window_set_managed( struct x11drv_win_data *data, BOOL new_managed ) @@ -1972,7 +1968,6 @@ void set_net_active_window( HWND hwnd, HWND previous ) TRACE( "requesting _NET_ACTIVE_WINDOW %p/%lx serial %lu\n", hwnd, window, data->net_active_window_serial ); XSendEvent( data->display, DefaultRootWindow( data->display ), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev ); - XFlush( data->display ); }
BOOL window_is_reparenting( HWND hwnd )
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/message.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index d61263f26e6..9e8f9d54af8 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3179,7 +3179,7 @@ static HANDLE get_server_queue_handle(void) return ret; }
-static BOOL has_hardware_messages(void) +static BOOL check_internal_bits( UINT mask ) { struct object_lock lock = OBJECT_LOCK_INIT; const queue_shm_t *queue_shm; @@ -3187,7 +3187,7 @@ static BOOL has_hardware_messages(void) UINT status;
while ((status = get_shared_queue( &lock, &queue_shm )) == STATUS_PENDING) - signaled = queue_shm->internal_bits & QS_HARDWARE; + signaled = queue_shm->internal_bits & mask; if (status) return FALSE;
return signaled; @@ -3195,7 +3195,7 @@ static BOOL has_hardware_messages(void)
BOOL process_driver_events( UINT mask ) { - if (user_driver->pProcessEvents( mask )) + if (check_internal_bits( QS_DRIVER ) && user_driver->pProcessEvents( mask )) { SERVER_START_REQ( set_queue_mask ) { @@ -3205,7 +3205,7 @@ BOOL process_driver_events( UINT mask ) SERVER_END_REQ; }
- return has_hardware_messages(); + return check_internal_bits( QS_HARDWARE ); }
void check_for_events( UINT flags )