[PATCH v3 07/10] winex11.drv: Merge FocusIn/FocusOut NotifyGrab/NotifyUngrab cases.

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


The return value was different as well, this makes it more consistent.

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

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index a08cd7a8c70..bd1b0cf2d72 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -854,18 +854,8 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
     if (event->detail == NotifyPointer) return FALSE;
     if (hwnd == GetDesktopWindow()) return FALSE;
 
-    switch (event->mode)
-    {
-    case NotifyGrab:
-        /* these are received when moving undecorated managed windows on mutter */
-        return FALSE;
-    case NotifyWhileGrabbed:
-        break;
-    case NotifyNormal:
-        break;
-    case NotifyUngrab:
-        return TRUE; /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
-    }
+    /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
+    if (event->mode == NotifyGrab || event->mode == NotifyUngrab) return FALSE;
 
     if ((xic = X11DRV_get_ic( hwnd ))) XSetICFocus( xic );
     if (use_take_focus && hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, FALSE );
@@ -947,18 +937,8 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
     }
     if (!hwnd) return FALSE;
 
-    switch (event->mode)
-    {
-    case NotifyUngrab:
-        /* these are received when moving undecorated managed windows on mutter */
-        return FALSE;
-    case NotifyNormal:
-        break;
-    case NotifyWhileGrabbed:
-        break;
-    case NotifyGrab:
-        return TRUE; /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
-    }
+    /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */
+    if (event->mode == NotifyGrab || event->mode == NotifyUngrab) return FALSE;
 
     focus_out( event->display, hwnd );
     return TRUE;
-- 
2.23.0




More information about the wine-devel mailing list