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
This commit is contained in:
Olivier Fourdan 2019-02-18 10:21:57 +01:00
parent 1dc602e289
commit 7bd668e6d0

View File

@ -3546,6 +3546,9 @@ handle_restore_shortcuts (MetaDisplay *display,
{ {
ClutterInputDevice *source; ClutterInputDevice *source;
if (!display->focus_window)
return;
source = clutter_event_get_source_device ((ClutterEvent *) event); source = clutter_event_get_source_device ((ClutterEvent *) event);
meta_topic (META_DEBUG_KEYBINDINGS, "Restoring normal keyboard shortcuts\n"); meta_topic (META_DEBUG_KEYBINDINGS, "Restoring normal keyboard shortcuts\n");