[PATCH v4 7/8] winex11.drv: Release pointer grab on FocusOut events.

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


When a window receives FocusOut event, whether it is because the WM is
grabbing the keyboard or because of an actual input focus change, we
should release the pointer grab.

We will re-apply it on FocusIn event if it is necessary from Wine's
perspective.

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

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index a02f697a77d..9f0d68f26f8 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -896,6 +896,8 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
     }
     if (!hwnd) return FALSE;
 
+    if (hwnd == GetForegroundWindow()) ungrab_clipping_window();
+
     /* 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