[PATCH] winex11.drv: Handle FocusIn/NotifyGrab and FocusOut/NotifyUngrab events.

Rémi Bernon rbernon at codeweavers.com
Mon Sep 23 02:58:17 CDT 2019


These events are received on mutter, when moving undecorated managed
windows, although Wine never grabs the keyboard itself.

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

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index f79f40c2323..25730192d3d 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -778,8 +778,9 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
     switch (event->mode)
     {
     case NotifyGrab:
-        WARN( "unexpected FocusIn event with NotifyGrab mode\n" );
-        break;
+        /* these are received when moving undecorated managed windows on mutter */
+        keyboard_grabbed = TRUE;
+        return FALSE;
     case NotifyWhileGrabbed:
         keyboard_grabbed = TRUE;
         break;
@@ -879,8 +880,9 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
     switch (event->mode)
     {
     case NotifyUngrab:
-        WARN( "unexpected FocusOut event with NotifyUngrab mode\n" );
-        break;
+        /* these are received when moving undecorated managed windows on mutter */
+        keyboard_grabbed = FALSE;
+        return FALSE;
     case NotifyNormal:
         keyboard_grabbed = FALSE;
         break;
-- 
2.23.0




More information about the wine-devel mailing list