summaryrefslogtreecommitdiff
path: root/src/ui/resizepopup.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-04-24 15:09:08 -0400
committerraveit65 <[email protected]>2018-04-29 09:17:07 +0200
commit04e564c74159cf3537c9aae2110f66474e46b3a2 (patch)
tree92564b721490cec73c92f8be65eb3de462d980f5 /src/ui/resizepopup.c
parent079c4581c209f3d867b7ba6b059afaf7c1541029 (diff)
downloadmarco-04e564c74159cf3537c9aae2110f66474e46b3a2.tar.bz2
marco-04e564c74159cf3537c9aae2110f66474e46b3a2.tar.xz
Correct resize popup position on HiDPI displays
Diffstat (limited to 'src/ui/resizepopup.c')
-rw-r--r--src/ui/resizepopup.c8
1 files changed, 8 insertions, 0 deletions
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 */