From db866eb0529753bbd4c572903616dba39298ebea Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 31 Jan 2018 13:41:25 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20send=20shortcut=20inhibit=20?= =?UTF-8?q?=E2=80=9Cactive=E2=80=9D=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shortcut inhibitor protocol states that the “active” event should be sent every time compositor shortcuts are inhibited on behalf of the surface. However, mutter would send that event only if the surface is focused, which might not be the case if focus is on a shell surface. Send the “active” event unconditionally to match the protocol definition. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/10 --- src/wayland/meta-wayland-inhibit-shortcuts.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/wayland/meta-wayland-inhibit-shortcuts.c b/src/wayland/meta-wayland-inhibit-shortcuts.c index 272ae5f2c..1a831607f 100644 --- a/src/wayland/meta-wayland-inhibit-shortcuts.c +++ b/src/wayland/meta-wayland-inhibit-shortcuts.c @@ -89,19 +89,13 @@ static void shortcuts_inhibited_cb (MetaWaylandSurface *surface, MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit) { - MetaWaylandKeyboard *keyboard = shortcut_inhibit->seat->keyboard; - - /* Send active event only if the surface has keyboard focus */ - if (keyboard->focus_surface == surface) - zwp_keyboard_shortcuts_inhibitor_v1_send_active (shortcut_inhibit->resource); + zwp_keyboard_shortcuts_inhibitor_v1_send_active (shortcut_inhibit->resource); } static void -shortcuts_restored_cb (MetaWaylandSurface *surface, - gpointer user_data) +shortcuts_restored_cb (MetaWaylandSurface *surface, + MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit) { - MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit = user_data; - zwp_keyboard_shortcuts_inhibitor_v1_send_inactive (shortcut_inhibit->resource); }