[PATCH v4 8/8] winex11.drv: Restore pointer grab on FocusIn events.

Rémi Bernon rbernon at codeweavers.com
Mon Oct 21 02:13:46 CDT 2019


We introduced unnecessary complexity by adding the last_clip_* state,
we can instead use the ClipCursor state.

This restores the ClipCursor on FocusIn events by sending a
WM_X11DRV_CLIP_CURSOR message to the foreground window, which will query
the current clipping rect from the server and apply it.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winex11.drv/event.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 9f0d68f26f8..08b985107ce 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -801,6 +801,9 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
     if (event->detail == NotifyPointer) return FALSE;
     if (hwnd == GetDesktopWindow()) return FALSE;
 
+    /* ask the foreground window to re-apply the current ClipCursor rect */
+    SendMessageW( GetForegroundWindow(), WM_X11DRV_CLIP_CURSOR, 0, 0 );
+
     /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
     if (event->mode == NotifyGrab || event->mode == NotifyUngrab) return FALSE;
 
-- 
2.23.0




More information about the wine-devel mailing list