summaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-05-15 13:32:01 +0200
committerDaniel Stone <daniels@collabora.com>2017-05-18 11:16:56 +0100
commit9e07d25a1b933007c403df27fa430a82a2327743 (patch)
tree436490821f4e84f47e5f0177f3d17266f0cf434a /xwayland
parenteca5cca56125052003861529eb2c181b420845aa (diff)
downloadweston-9e07d25a1b933007c403df27fa430a82a2327743.tar.gz
xwm: Don't change focus on focus events from grabs
xwm would not let X clients change the focus behind the compositor's back, reverting focus where it's supposed to be when this occurs. However, X11 grab also issue focus in events, on which some clients rely and reverting focus in this case braks the client logic (e.g. combobox menu in gtk+ using the X11 backend). Check if the focus event is actually coming from a grab or ungrab and do not revert focus in this case, to avoid breaking clients logic. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/window-manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 26080759..25008539 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -2055,6 +2055,12 @@ static void
weston_wm_handle_focus_in(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_focus_in_event_t *focus = (xcb_focus_in_event_t *) event;
+
+ /* Do not interfere with grabs */
+ if (focus->mode == XCB_NOTIFY_MODE_GRAB ||
+ focus->mode == XCB_NOTIFY_MODE_UNGRAB)
+ return;
+
/* Do not let X clients change the focus behind the compositor's
* back. Reset the focus to the old one if it changed. */
if (!wm->focus_window || focus->event != wm->focus_window->id)