wayland: send shortcut inhibit “active” event

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
This commit is contained in:
Olivier Fourdan 2018-01-31 13:41:25 +01:00
parent d092e913d6
commit db866eb052

View File

@ -89,19 +89,13 @@ static void
shortcuts_inhibited_cb (MetaWaylandSurface *surface, shortcuts_inhibited_cb (MetaWaylandSurface *surface,
MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit) MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit)
{ {
MetaWaylandKeyboard *keyboard = shortcut_inhibit->seat->keyboard; zwp_keyboard_shortcuts_inhibitor_v1_send_active (shortcut_inhibit->resource);
/* 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);
} }
static void static void
shortcuts_restored_cb (MetaWaylandSurface *surface, shortcuts_restored_cb (MetaWaylandSurface *surface,
gpointer user_data) MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit)
{ {
MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit = user_data;
zwp_keyboard_shortcuts_inhibitor_v1_send_inactive (shortcut_inhibit->resource); zwp_keyboard_shortcuts_inhibitor_v1_send_inactive (shortcut_inhibit->resource);
} }