From 77dd1bf63532946ba88bc959e9cc8a7991665035 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 18 Jan 2018 13:58:02 +0100 Subject: [PATCH] wayland: shortcuts inhibitor requires a window Issuing a shortcut inhibit request for a surface without a window set will lead to a crash when trying to show the shortcut inhibitor dialog. In such a case, it's safer to deny the request. https://bugzilla.gnome.org/show_bug.cgi?id=792599 --- src/wayland/meta-wayland-inhibit-shortcuts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-inhibit-shortcuts.c b/src/wayland/meta-wayland-inhibit-shortcuts.c index 8e5ed2413..272ae5f2c 100644 --- a/src/wayland/meta-wayland-inhibit-shortcuts.c +++ b/src/wayland/meta-wayland-inhibit-shortcuts.c @@ -148,7 +148,9 @@ zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts (struct wl_client *cl G_CALLBACK (surface_destroyed_cb), shortcut_inhibit); - meta_wayland_surface_show_inhibit_shortcuts_dialog (surface, seat); + /* Cannot grant shortcuts to a surface without any window */ + if (meta_wayland_surface_get_toplevel_window (surface)) + meta_wayland_surface_show_inhibit_shortcuts_dialog (surface, seat); wl_resource_set_implementation (keyboard_shortcuts_inhibit_resource, &meta_keyboard_shortcuts_inhibit_interface,