[mutter] MetaWindow: Clear fullscreen monitors when monitors change



commit 103df63023846977124d7ac0221321a0da7518ed
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Nov 29 16:13:21 2016 +0800

    MetaWindow: Clear fullscreen monitors when monitors change
    
    The fullscreen monitors state is set given a set of xinerama monitor
    identification numbers. When the monitor configuration changes (e.g. by
    a hotplug event) these are no longer valid, and may point to
    uninitialized or unallocated data. Avoid accessing
    uninitialized/unallocated memory by clearing the fullscreen monitor
    state when the monitor configuration changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777732

 src/core/window.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 0b01706..ed0bef0 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3540,6 +3540,9 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
 {
   const MetaLogicalMonitor *old, *new;
 
+  if (window->fullscreen_monitors[0] != -1)
+    window->fullscreen_monitors[0] = -1;
+
   if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
     {
       meta_window_update_monitor (window, FALSE);


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