[PATCH] winex11.drv/window: Sync the window cursor before grabbing it

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Dec 13 05:16:45 CST 2018


If a window changes the cursor (e.g. resizing cursor) and then sends the
WM_SYSCOMMAND message to resize/move another window in response to something
(e.g. a click), and the other window had a different cursor, XGrabPointer
will switch the resizing cursor to the other window's cursor, until the mouse
is moved, which then syncs back to the respective sizing/move cursor. This
results in an annoying "flicker" of the cursor in such cases as it changes
from resize cursor->prev cursor->resize cursor.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---

This syncs the cursor so that the window's cursor becomes the sizing cursor
(or whatever other cursor is current) before XGrabPointer.

I'm experimenting with implementing the resizing grip in the autocomplete
listbox exactly like on Windows (for post Wine 4.0) and discovered this in
the process, since the resizing grip has to send the resize command to the
listbox, but the listbox's cursor is not synced until the mouse is moved
(without this patch).

 dlls/winex11.drv/window.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 7a3b340..4b5f9f9 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2159,6 +2159,7 @@ void CDECL X11DRV_SetCapture( HWND hwnd, UINT flags )
         if (!(data = get_win_data( GetAncestor( hwnd, GA_ROOT )))) return;
         if (data->whole_window)
         {
+            sync_window_cursor( data->whole_window );
             XFlush( gdi_display );
             XGrabPointer( data->display, data->whole_window, False,
                           PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
-- 
2.19.1




More information about the wine-devel mailing list