core/window: Don't set a preferred output when there is none

If there are no active logical monitors, don't try to dereference a
NULL one to get a preferred output winsys id. Instead just set an
invalid one.

https://bugzilla.gnome.org/show_bug.cgi?id=730551
This commit is contained in:
Jonas Ådahl 2017-04-12 14:21:49 +08:00
parent 0aa7405a2a
commit 7562eb6006

View File

@ -1039,7 +1039,10 @@ _meta_window_shared_new (MetaDisplay *display,
window->compositor_private = NULL;
window->monitor = meta_window_calculate_main_logical_monitor (window);
window->preferred_output_winsys_id = window->monitor->winsys_id;
if (window->monitor)
window->preferred_output_winsys_id = window->monitor->winsys_id;
else
window->preferred_output_winsys_id = UINT_MAX;
window->tile_match = NULL;