From 7562eb600659e86304d90f3fe666116a081c75ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 12 Apr 2017 14:21:49 +0800 Subject: [PATCH] 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 --- src/core/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/window.c b/src/core/window.c index ec3083f80..f3ff8fd5b 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -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;