From: "Rémi Bernon" Subject: [PATCH v3 07/10] winex11.drv: Merge FocusIn/FocusOut NotifyGrab/NotifyUngrab cases. Message-Id: <20191007130216.21159-8-rbernon@codeweavers.com> Date: Mon, 7 Oct 2019 15:02:13 +0200 In-Reply-To: <20191007130216.21159-1-rbernon@codeweavers.com> References: <20191007130216.21159-1-rbernon@codeweavers.com> The return value was different as well, this makes it more consistent. Signed-off-by: Rémi Bernon --- 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