Skip to content
Permalink
Browse files

Correct resize popup position on HiDPI displays

  • Loading branch information...
vkareh authored and raveit65 committed Apr 24, 2018
1 parent 079c458 commit 04e564c74159cf3537c9aae2110f66474e46b3a2
Showing with 13 additions and 2 deletions.
  1. +5 −2 src/core/window.c
  2. +8 −0 src/ui/resizepopup.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);
@@ -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 */

0 comments on commit 04e564c

Please sign in to comment.
You can’t perform that action at this time.