summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-04-24 15:09:08 -0400
committerraveit65 <[email protected]>2018-04-29 13:56:15 +0200
commit8074c01f0e8d15cc0b625c2ad34ff57c0a2fbf3b (patch)
tree6600830e93a6830e2ec3967cf28e646006688002
parent45d8f75f6fb9bf7945549e400d192e0982a8fa5d (diff)
downloadmarco-8074c01f0e8d15cc0b625c2ad34ff57c0a2fbf3b.tar.bz2
marco-8074c01f0e8d15cc0b625c2ad34ff57c0a2fbf3b.tar.xz
Correct resize popup position on HiDPI displays
-rw-r--r--src/core/window.c7
-rw-r--r--src/ui/resizepopup.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/src/core/window.c b/src/core/window.c
index 3f6314d6..f366ff1b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8060,8 +8060,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 c60fcd65..0464636d 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 */