{
if (f->size_hint_flags & (USPosition | PPosition))
{
+ int scale = xg_get_scale (f);
#if ! GTK_CHECK_VERSION (3, 22, 0)
if (x_gtk_use_window_move)
{
f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
- FRAME_PIXEL_HEIGHT (f) + f->top_pos);
+ /* GTK works in scaled pixels, so convert from X pixels. */
gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- f->left_pos, f->top_pos);
+ f->left_pos / scale, f->top_pos / scale);
/* Reset size hint flags. */
f->size_hint_flags &= ~ (XNegative | YNegative);
}
else
{
- int left = f->left_pos;
+ /* GTK works in scaled pixels, so convert from X pixels. */
+ int left = f->left_pos / scale;
int xneg = f->size_hint_flags & XNegative;
- int top = f->top_pos;
+ int top = f->top_pos / scale;
int yneg = f->size_hint_flags & YNegative;
char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
guint id;
x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
{
int modified_top, modified_left;
+ int scale = xg_get_scale (f);
if (change_gravity > 0)
{
if (x_gtk_use_window_move)
{
/* When a position change was requested and the outer GTK widget
- has been realized already, leave it to gtk_window_move to DTRT
- and return. Used for Bug#25851 and Bug#25943. */
+ has been realized already, leave it to gtk_window_move to
+ DTRT and return. Used for Bug#25851 and Bug#25943. Convert
+ from X pixels to GTK scaled pixels. */
if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f))
gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- f->left_pos, f->top_pos);
+ f->left_pos / scale, f->top_pos / scale);
unblock_input ();
return;
}
}
#ifdef USE_GTK
+ /* Make sure we adjust for possible scaling. */
gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- modified_left, modified_top);
+ modified_left / scale, modified_top / scale);
#else
XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
modified_left, modified_top);