window: Handle maximize when headless

When for some reason a window is maximized while the compositor is
headless, `window->monitor` will be NULL, so check for a NULL monitor
to avoid a NULL-pointer dereference.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/58

https://gitlab.gnome.org/GNOME/mutter/merge_requests/383
This commit is contained in:
Olivier Fourdan 2019-01-09 11:52:18 +01:00
parent f740e8ed79
commit 582b67a2f1

View File

@ -2848,7 +2848,7 @@ meta_window_maximize_internal (MetaWindow *window,
meta_window_recalc_features (window);
set_net_wm_state (window);
if (window->monitor->in_fullscreen)
if (window->monitor && window->monitor->in_fullscreen)
meta_display_queue_check_fullscreen (window->display);
g_object_freeze_notify (G_OBJECT (window));