[mutter/wip/texture-purge-on-nvidia: 11/66] window/wayland: Always update monitor for non-user ops



commit e0db7d75c924a07da2b366c9c9e5075dd7bea6e6
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Mon Jun 18 10:39:11 2018 +0000

    window/wayland: Always update monitor for non-user ops
    
    meta_window_wayland_update_main_monitor() would skip the monitor update
    if the difference in scale between the old and the new monitor would
    cause another monitor change.
    
    While this is suitable when the monitor change results from a user
    interactively moving the surface between monitors of different scales,
    this can leave dangling pointers to freed monitors when this is
    triggered by a change of monitor configuration.
    
    Make sure we update the monitor unconditionally if not from a user
    operation.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189
    
    (cherry picked from commit a3da4b8d5bd217c0262fd9361036877d155a300f)

 src/wayland/meta-window-wayland.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index 8bafb252f..4b16d0d9c 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -419,6 +419,12 @@ meta_window_wayland_update_main_monitor (MetaWindow *window,
       return;
     }
 
+  if (!user_op)
+    {
+      window->monitor = to;
+      return;
+    }
+
   from_scale = meta_logical_monitor_get_scale (from);
   to_scale = meta_logical_monitor_get_scale (to);
 


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