[mutter] window: Handle updating from no to no monitor



commit 6eb7d138940c44793d424619e86eab4007e2572c
Author: Jonas Ådahl <jadahl gmail com>
Date:   Sat Oct 7 00:33:39 2017 -0400

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index dc60a66..c2d9869 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]