r51436 - in /desktop/unstable/mutter/debian: ./ patches/

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Fri Oct 14 19:34:22 UTC 2016


Author: sjoerd
Date: Fri Oct 14 19:34:21 2016
New Revision: 51436

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=51436
Log:
* d/p/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch
  d/p/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch
  d/p/wayland-xdg-popup-Force-monitor-of-the-top-level.patch
  d/p/wayland-xdg-shell-update-popup-window-monitor-early.patch
  d/p/wayland-xdg-shell-Scale-positioner-coordinates.patch:
    - Added. Fix positioning of popups on hidpi screens in wayland

Added:
    desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch
    desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Force-monitor-of-the-top-level.patch
    desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch
    desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-positioner-coordinates.patch
    desktop/unstable/mutter/debian/patches/wayland-xdg-shell-update-popup-window-monitor-early.patch
Modified:
    desktop/unstable/mutter/debian/changelog
    desktop/unstable/mutter/debian/patches/series

Modified: desktop/unstable/mutter/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/changelog?rev=51436&op=diff
==============================================================================
--- desktop/unstable/mutter/debian/changelog	[utf-8] (original)
+++ desktop/unstable/mutter/debian/changelog	[utf-8] Fri Oct 14 19:34:21 2016
@@ -1,3 +1,14 @@
+mutter (3.22.1-2) UNRELEASED; urgency=medium
+
+  * d/p/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch
+    d/p/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch
+    d/p/wayland-xdg-popup-Force-monitor-of-the-top-level.patch
+    d/p/wayland-xdg-shell-update-popup-window-monitor-early.patch
+    d/p/wayland-xdg-shell-Scale-positioner-coordinates.patch:
+      - Added. Fix positioning of popups on hidpi screens in wayland
+
+ -- Sjoerd Simons <sjoerd at debian.org>  Wed, 12 Oct 2016 21:54:33 +0200
+
 mutter (3.22.1-1) unstable; urgency=medium
 
   * New upstream release.

Modified: desktop/unstable/mutter/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/series?rev=51436&op=diff
==============================================================================
--- desktop/unstable/mutter/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/mutter/debian/patches/series	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,5 @@
+wayland-xdg-popup-Always-use-monitor-of-toplevel.patch
+wayland-xdg-shell-Scale-configure-relative-popup-coo.patch
+wayland-xdg-popup-Force-monitor-of-the-top-level.patch
+wayland-xdg-shell-update-popup-window-monitor-early.patch
+wayland-xdg-shell-Scale-positioner-coordinates.patch

Added: desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch?rev=51436&op=file
==============================================================================
--- desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch	(added)
+++ desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Always-use-monitor-of-toplevel.patch	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,72 @@
+From 5c6e04ca80bb85c84effbe93ea8fa76883b9df4c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl at gmail.com>
+Date: Fri, 23 Sep 2016 17:15:56 +0800
+Subject: [PATCH] wayland/xdg-popup: Always use monitor of toplevel
+
+Always use the monitor of the toplevel surface's window, so that the
+popup menu and the parent will always have the same scale. This fixes
+the dimensions sent in the xdg_popup configure event.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=771841
+---
+ src/wayland/meta-wayland-xdg-shell.c |  1 +
+ src/wayland/meta-window-wayland.c    | 24 ++++++++++++++++++------
+ 2 files changed, 19 insertions(+), 6 deletions(-)
+
+diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
+index e9223a9..591a1ed 100644
+--- a/src/wayland/meta-wayland-xdg-shell.c
++++ b/src/wayland/meta-wayland-xdg-shell.c
+@@ -1463,6 +1463,7 @@ xdg_surface_constructor_get_toplevel (struct wl_client   *client,
+ 
+   window = meta_window_wayland_new (meta_get_display (), surface);
+   meta_wayland_surface_set_window (surface, window);
++  meta_window_update_monitor (window, FALSE);
+ }
+ 
+ static void
+diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
+index 1b3e090..fd630ca 100644
+--- a/src/wayland/meta-window-wayland.c
++++ b/src/wayland/meta-window-wayland.c
+@@ -334,19 +334,31 @@ scale_rect_size (MetaRectangle *rect,
+ static void
+ meta_window_wayland_update_main_monitor (MetaWindow *window)
+ {
++  MetaWindow *toplevel_window;
+   const MetaMonitorInfo *from;
+   const MetaMonitorInfo *to;
+   const MetaMonitorInfo *scaled_new;
+   float scale;
+   MetaRectangle rect;
+ 
+-  /* 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. */
+   from = window->monitor;
+-  to = meta_screen_calculate_monitor_for_window (window->screen, window);
++
++  /* If the window is not a toplevel window (i.e. it's a popup window) just use
++   * the monitor of the toplevel. */
++  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);
++    }
+ 
+   if (from == to)
+     return;
+-- 
+2.9.3
+

Added: desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Force-monitor-of-the-top-level.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Force-monitor-of-the-top-level.patch?rev=51436&op=file
==============================================================================
--- desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Force-monitor-of-the-top-level.patch	(added)
+++ desktop/unstable/mutter/debian/patches/wayland-xdg-popup-Force-monitor-of-the-top-level.patch	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,50 @@
+From 388260670d41d0cfbc102136d8d6afab2c7f587b Mon Sep 17 00:00:00 2001
+From: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
+Date: Fri, 23 Sep 2016 23:09:39 +0200
+Subject: [PATCH] wayland/xdg-popup: Force monitor of the top-level
+
+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 at collabora.co.uk>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=771841
+---
+ src/wayland/meta-window-wayland.c | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
+index fd630ca..a497dec 100644
+--- a/src/wayland/meta-window-wayland.c
++++ b/src/wayland/meta-window-wayland.c
+@@ -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;
+ 
+-- 
+2.9.3
+

Added: desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch?rev=51436&op=file
==============================================================================
--- desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch	(added)
+++ desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-configure-relative-popup-coo.patch	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,40 @@
+From 54b91826cca99cf46d3ffb34f3de2232e36eac80 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl at gmail.com>
+Date: Fri, 23 Sep 2016 17:18:21 +0800
+Subject: [PATCH] wayland/xdg-shell: Scale configure relative popup coordinate
+
+The parent local popup coordinate needs to be scaled according to the
+monitor scale it is assigned.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=771841
+---
+ src/wayland/meta-wayland-xdg-shell.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
+index 591a1ed..b1b3771 100644
+--- a/src/wayland/meta-wayland-xdg-shell.c
++++ b/src/wayland/meta-wayland-xdg-shell.c
+@@ -873,6 +873,7 @@ xdg_popup_role_configure (MetaWaylandSurfaceRoleShellSurface *shell_surface_role
+   MetaWaylandXdgPopup *xdg_popup = META_WAYLAND_XDG_POPUP (shell_surface_role);
+   MetaWaylandXdgSurface *xdg_surface = META_WAYLAND_XDG_SURFACE (xdg_popup);
+   MetaWindow *parent_window = xdg_popup->parent_surface->window;
++  int monitor_scale;
+   int x, y;
+ 
+   /* If the parent surface was destroyed, its window will be destroyed
+@@ -886,8 +887,9 @@ xdg_popup_role_configure (MetaWaylandSurfaceRoleShellSurface *shell_surface_role
+   if (!parent_window)
+     return;
+ 
+-  x = new_x - parent_window->rect.x;
+-  y = new_y - parent_window->rect.y;
++  monitor_scale = meta_window_wayland_get_main_monitor_scale (parent_window);
++  x = (new_x - parent_window->rect.x) / monitor_scale;
++  y = (new_y - parent_window->rect.y) / monitor_scale;
+   zxdg_popup_v6_send_configure (xdg_popup->resource,
+                                 x, y, new_width, new_height);
+   meta_wayland_xdg_surface_send_configure (xdg_surface);
+-- 
+2.9.3
+

Added: desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-positioner-coordinates.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-positioner-coordinates.patch?rev=51436&op=file
==============================================================================
--- desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-positioner-coordinates.patch	(added)
+++ desktop/unstable/mutter/debian/patches/wayland-xdg-shell-Scale-positioner-coordinates.patch	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,84 @@
+From 1bd2ae8e7cef3cd284670f7a05b5faf11fd48028 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl at gmail.com>
+Date: Thu, 13 Oct 2016 13:56:00 +0800
+Subject: [PATCH] wayland/xdg-shell: Scale positioner coordinates
+
+When the monitor is scaled (i.e. HiDPI scaling) the placement coordinates
+ere still in unscaled xdg_surface window geometry coordinate space when
+used to place the window. Fix this by scaling the coordinates by the
+monitor scale of the parent toplevel window before using them.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=771841
+---
+ src/wayland/meta-wayland-xdg-shell.c | 29 ++++++++++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
+index 4e572dc..005e753 100644
+--- a/src/wayland/meta-wayland-xdg-shell.c
++++ b/src/wayland/meta-wayland-xdg-shell.c
+@@ -109,6 +109,11 @@ struct _MetaWaylandXdgPopup
+ 
+   struct {
+     MetaWaylandSurface *parent_surface;
++
++    /*
++     * The coordinates/dimensions in the placement rule are in logical pixel
++     * coordinate space, i.e. not scaled given what monitor the popup is on.
++     */
+     MetaPlacementRule placement_rule;
+ 
+     MetaWaylandSeat *grab_seat;
+@@ -758,20 +763,35 @@ meta_wayland_xdg_toplevel_class_init (MetaWaylandXdgToplevelClass *klass)
+ }
+ 
+ static void
++scale_placement_rule (MetaPlacementRule  *placement_rule,
++                      MetaWaylandSurface *surface)
++{
++  int monitor_scale = surface->window->monitor->scale;
++
++  placement_rule->anchor_rect.x *= monitor_scale;
++  placement_rule->anchor_rect.y *= monitor_scale;
++  placement_rule->anchor_rect.width *= monitor_scale;
++  placement_rule->anchor_rect.height *= monitor_scale;
++  placement_rule->offset_x *= monitor_scale;
++  placement_rule->offset_y *= monitor_scale;
++  placement_rule->width *= monitor_scale;
++  placement_rule->height *= monitor_scale;
++}
++
++static void
+ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
+ {
+   MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (xdg_popup);
+   MetaWaylandSurface *surface =
+     meta_wayland_surface_role_get_surface (surface_role);
+   MetaWaylandSurface *parent_surface;
+-  MetaPlacementRule placement_rule;
++  MetaPlacementRule scaled_placement_rule;
+   MetaWaylandSeat *seat;
+   uint32_t serial;
+   MetaDisplay *display = meta_get_display ();
+   MetaWindow *window;
+ 
+   parent_surface = xdg_popup->setup.parent_surface;
+-  placement_rule = xdg_popup->setup.placement_rule;
+   seat = xdg_popup->setup.grab_seat;
+   serial = xdg_popup->setup.grab_serial;
+ 
+@@ -795,7 +815,10 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
+   window = meta_window_wayland_new (display, surface);
+   meta_wayland_surface_set_window (surface, window);
+   meta_window_update_monitor (window, FALSE);
+-  meta_window_place_with_placement_rule (window, &placement_rule);
++
++  scaled_placement_rule = xdg_popup->setup.placement_rule;
++  scale_placement_rule (&scaled_placement_rule, surface);
++  meta_window_place_with_placement_rule (window, &scaled_placement_rule);
+ 
+   if (seat)
+     {
+-- 
+2.9.3
+

Added: desktop/unstable/mutter/debian/patches/wayland-xdg-shell-update-popup-window-monitor-early.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/mutter/debian/patches/wayland-xdg-shell-update-popup-window-monitor-early.patch?rev=51436&op=file
==============================================================================
--- desktop/unstable/mutter/debian/patches/wayland-xdg-shell-update-popup-window-monitor-early.patch	(added)
+++ desktop/unstable/mutter/debian/patches/wayland-xdg-shell-update-popup-window-monitor-early.patch	[utf-8] Fri Oct 14 19:34:21 2016
@@ -0,0 +1,34 @@
+From 193543f976e6a5857175eecfe192b68c305bf752 Mon Sep 17 00:00:00 2001
+From: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
+Date: Fri, 23 Sep 2016 23:12:56 +0200
+Subject: [PATCH] wayland/xdg-shell: update popup window monitor early
+
+As meta_window_place_with_placement_rule will trigger a configure event
+being sent ensure that the popup is placed on the correct monitor first
+to ensure the right scale factor is applied.
+
+Signed-off-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=771841
+---
+ src/wayland/meta-wayland-xdg-shell.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
+index b1b3771..4e572dc 100644
+--- a/src/wayland/meta-wayland-xdg-shell.c
++++ b/src/wayland/meta-wayland-xdg-shell.c
+@@ -793,8 +793,9 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
+                                     &xdg_popup->parent_destroy_listener);
+ 
+   window = meta_window_wayland_new (display, surface);
+-  meta_window_place_with_placement_rule (window, &placement_rule);
+   meta_wayland_surface_set_window (surface, window);
++  meta_window_update_monitor (window, FALSE);
++  meta_window_place_with_placement_rule (window, &placement_rule);
+ 
+   if (seat)
+     {
+-- 
+2.9.3
+




More information about the pkg-gnome-commits mailing list