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@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;