1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-31 01:32:00 -07:00

[GTK3, HiDPI] Fix width/height round-trip through ConfigureNotify

* src/gtkutil.c (xg_frame_set_char_size)
(xg_frame_set_size_and_position): Truncate WIDTH and HEIGHT to
be multiples of the scale factor (bug#80662).
This commit is contained in:
Dmitry Gutov 2026-05-11 03:32:29 +03:00
parent acc07f1a03
commit 196fd80689

View file

@ -1181,6 +1181,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
int outer_height
= height + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
int outer_width = width + FRAME_TOOLBAR_WIDTH (f);
int scale = xg_get_scale (f);
#ifndef HAVE_PGTK
gtk_window_get_size (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
@ -1200,8 +1201,10 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
}
#endif
outer_height /= xg_get_scale (f);
outer_width /= xg_get_scale (f);
outer_height /= scale;
outer_width /= scale;
height = outer_height * scale;
width = outer_width * scale;
xg_wm_set_size_hint (f, 0, 0);
@ -1328,6 +1331,9 @@ xg_frame_set_size_and_position (struct frame *f, int width, int height)
outer_height /= scale;
outer_width /= scale;
height = outer_height * scale;
width = outer_width * scale;
x /= scale;
y /= scale;