[PATCH v3 09/10] winex11.drv: Use the current clipping rectangle when restoring grabs.

Rémi Bernon rbernon at codeweavers.com
Mon Oct 7 08:02:15 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 d0b92f30153..b41093856e3 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -854,6 +854,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