[marco] 01/02: debian/patches: Add 0001_fix_resize_popup.patch. Correct resize popup position on HiDPI displays.

Martin Wimpress flexiondotorg-guest at moszumanska.debian.org
Wed Apr 25 12:23:18 BST 2018


This is an automated email from the git hooks/post-receive script.

flexiondotorg-guest pushed a commit to branch master
in repository marco.

commit d137514b7af8a47bdfc7d62574644e02115d7af8
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date:   Wed Apr 25 10:47:37 2018 +0100

    debian/patches: Add 0001_fix_resize_popup.patch. Correct resize popup position on HiDPI displays.
---
 debian/patches/0001_fix_resize_popup.patch | 50 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 51 insertions(+)

diff --git a/debian/patches/0001_fix_resize_popup.patch b/debian/patches/0001_fix_resize_popup.patch
new file mode 100644
index 0000000..0e03781
--- /dev/null
+++ b/debian/patches/0001_fix_resize_popup.patch
@@ -0,0 +1,50 @@
+Author: Victor Kareh <vkareh at vkareh.net>
+Description: Correct resize popup position on HiDPI displays
+
+diff --git a/src/core/window.c b/src/core/window.c
+index abd5af4..44084a0 100644
+--- a/src/core/window.c
++++ b/src/core/window.c
+@@ -8073,8 +8073,11 @@ meta_window_refresh_resize_popup (MetaWindow *window)
+ 
+   if (window->display->grab_resize_popup == NULL)
+     {
+-      if (window->size_hints.width_inc > 1 ||
+-          window->size_hints.height_inc > 1)
++      gint scale = gdk_window_get_scale_factor (gdk_get_default_root_window ());
++      /* Display the resize popup only for windows that report an
++       * increment hint that's larger than the scale factor. */
++      if (window->size_hints.width_inc > scale ||
++          window->size_hints.height_inc > scale)
+         window->display->grab_resize_popup =
+           meta_ui_resize_popup_new (window->display->xdisplay,
+                                     window->screen->number);
+diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c
+index c60fcd6..0464636 100644
+--- a/src/ui/resizepopup.c
++++ b/src/ui/resizepopup.c
+@@ -106,9 +106,11 @@ update_size_window (MetaResizePopup *popup)
+   char *str;
+   int x, y;
+   int width, height;
++  int scale;
+ 
+   g_return_if_fail (popup->size_window != NULL);
+ 
++  scale = gtk_widget_get_scale_factor (GTK_WIDGET (popup->size_window));
+   /* Translators: This represents the size of a window.  The first number is
+    * the width of the window and the second is the height.
+    */
+@@ -125,6 +127,12 @@ update_size_window (MetaResizePopup *popup)
+   x = popup->rect.x + (popup->rect.width - width) / 2;
+   y = popup->rect.y + (popup->rect.height - height) / 2;
+ 
++  if (scale)
++    {
++      x = x / scale;
++      y = y / scale;
++    }
++
+   if (gtk_widget_get_realized (popup->size_window))
+     {
+       /* using move_resize to avoid jumpiness */
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..de96e5a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001_fix_resize_popup.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/marco.git



More information about the pkg-mate-commits mailing list