wayland/xdg-popup: Force monitor of the top-level
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 23 Sep 2016 21:09:39 +0000 (23:09 +0200)
committerSjoerd Simons <sjoerd@debian.org>
Fri, 14 Oct 2016 20:01:14 +0000 (20:01 +0000)
Directly set the monitor of the toplevel window for the popup to avoid
the change not being applied due to later constraints calculation.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
https://bugzilla.gnome.org/show_bug.cgi?id=771841

Gbp-Pq: Name wayland-xdg-popup-Force-monitor-of-the-top-level.patch

src/wayland/meta-window-wayland.c

index fd630ca74c23e4e1feba89946da239d4b9f06186..a497decc0183d7413658e4295f433fc1664425fc 100644 (file)
@@ -348,18 +348,17 @@ meta_window_wayland_update_main_monitor (MetaWindow *window)
   toplevel_window = meta_wayland_surface_get_toplevel_window (window->surface);
   if (toplevel_window != window)
     {
-      to = toplevel_window->monitor;
-    }
-  else
-    {
-      /* Require both the current and the new monitor would be the new main monitor,
-       * even given the resulting scale the window would end up having. This is
-       * needed to avoid jumping back and forth between the new and the old, since
-       * changing main monitor may cause the window to be resized so that it no
-       * longer have that same new main monitor. */
-      to = meta_screen_calculate_monitor_for_window (window->screen, window);
+      window->monitor = toplevel_window->monitor;
+      return;
     }
 
+  /* Require both the current and the new monitor would be the new main monitor,
+   * even given the resulting scale the window would end up having. This is
+   * needed to avoid jumping back and forth between the new and the old, since
+   * changing main monitor may cause the window to be resized so that it no
+   * longer have that same new main monitor. */
+  to = meta_screen_calculate_monitor_for_window (window->screen, window);
+
   if (from == to)
     return;