kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0001-window-wayland-Always-update-monitor-for-non-user-op.patch

776610
From d74a046060df81ea766e999b4110e926b121cf2e Mon Sep 17 00:00:00 2001
776610
From: Olivier Fourdan <ofourdan@redhat.com>
776610
Date: Mon, 18 Jun 2018 10:39:11 +0000
776610
Subject: [PATCH] window/wayland: Always update monitor for non-user ops
776610
776610
meta_window_wayland_update_main_monitor() would skip the monitor update
776610
if the difference in scale between the old and the new monitor would
776610
cause another monitor change.
776610
776610
While this is suitable when the monitor change results from a user
776610
interactively moving the surface between monitors of different scales,
776610
this can leave dangling pointers to freed monitors when this is
776610
triggered by a change of monitor configuration.
776610
776610
Make sure we update the monitor unconditionally if not from a user
776610
operation.
776610
776610
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189
776610
776610
776610
(cherry picked from commit a3da4b8d5bd217c0262fd9361036877d155a300f)
776610
---
776610
 src/wayland/meta-window-wayland.c | 6 ++++++
776610
 1 file changed, 6 insertions(+)
776610
776610
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
776610
index 705bc4981..8bafb252f 100644
776610
--- a/src/wayland/meta-window-wayland.c
776610
+++ b/src/wayland/meta-window-wayland.c
776610
@@ -413,6 +413,12 @@ meta_window_wayland_update_main_monitor (MetaWindow *window,
776610
       return;
776610
     }
776610
 
776610
+  if (!user_op)
776610
+    {
776610
+      window->monitor = to;
776610
+      return;
776610
+    }
776610
+
776610
   from_scale = meta_logical_monitor_get_scale (from);
776610
   to_scale = meta_logical_monitor_get_scale (to);
776610
 
776610
-- 
776610
2.19.0
776610