[mutter] window: Do not restore shortcuts on a NULL window



commit 7bd668e6d0081ff4a22617625347e54ca7138819
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Mon Feb 18 10:21:57 2019 +0100

    window: Do not restore shortcuts on a NULL window
    
    The "force restore shortcuts" being triggered by a key-combo, there is
    no guarantee that the currently focused window is actually non-NULL in
    which case we would crash.
    
    Make sure there is a window currently focused before trying to restore
    the shortcuts on that window.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/464

 src/core/keybindings.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 3830492a9..340e2a705 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -3546,6 +3546,9 @@ handle_restore_shortcuts (MetaDisplay     *display,
 {
   ClutterInputDevice *source;
 
+  if (!display->focus_window)
+    return;
+
   source = clutter_event_get_source_device ((ClutterEvent *) event);
 
   meta_topic (META_DEBUG_KEYBINDINGS, "Restoring normal keyboard shortcuts\n");


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