[mutter/gnome-3-26] wayland: shortcuts inhibitor requires a window



commit 77dd1bf63532946ba88bc959e9cc8a7991665035
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Thu Jan 18 13:58:02 2018 +0100

    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 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-inhibit-shortcuts.c b/src/wayland/meta-wayland-inhibit-shortcuts.c
index 8e5ed24..272ae5f 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]