From 6eb7d138940c44793d424619e86eab4007e2572c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 7 Oct 2017 00:33:39 -0400 Subject: [PATCH] window: Handle updating from no to no monitor When we received two hot plug events that both resulted in headless configuration, we tried to find a new window monitor given the old. That resulted in a null pointer dereference; avoid that by only trying to find the same monitor if there was an old one. https://bugzilla.gnome.org/show_bug.cgi?id=788607 --- src/core/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/window.c b/src/core/window.c index dc60a667c..c2d9869d2 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3793,7 +3793,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window) new = find_monitor_by_winsys_id (window, window->preferred_output_winsys_id); /* Otherwise, try to find the old output on a new monitor */ - if (!new) + if (old && !new) new = find_monitor_by_winsys_id (window, old->winsys_id); /* Fall back to primary if everything else failed */