Fix a few issues with latest GTK scaling changes
* src/xfns.c (Fx_display_monitor_attributes_list): Call gdk_screen_get_monitor_scale_factor only for GTK versions 3.10..3.21. * src/xterm.c (x_set_offset): Call xg_get_scale for GTK only.
This commit is contained in:
parent
59db8dca03
commit
1412cf3edd
2 changed files with 4 additions and 2 deletions
|
@ -4940,7 +4940,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
|
||||||
gint width_mm = -1, height_mm = -1;
|
gint width_mm = -1, height_mm = -1;
|
||||||
GdkRectangle rec, work;
|
GdkRectangle rec, work;
|
||||||
struct MonitorInfo *mi = &monitors[i];
|
struct MonitorInfo *mi = &monitors[i];
|
||||||
int scale;
|
int scale = 1;
|
||||||
|
|
||||||
#if GTK_CHECK_VERSION (3, 22, 0)
|
#if GTK_CHECK_VERSION (3, 22, 0)
|
||||||
GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i);
|
GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i);
|
||||||
|
@ -4989,7 +4989,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
|
||||||
/* GTK returns scaled sizes for the workareas. */
|
/* GTK returns scaled sizes for the workareas. */
|
||||||
#if GTK_CHECK_VERSION (3, 22, 0)
|
#if GTK_CHECK_VERSION (3, 22, 0)
|
||||||
scale = gdk_monitor_get_scale_factor (monitor);
|
scale = gdk_monitor_get_scale_factor (monitor);
|
||||||
#else
|
#elif GTK_CHECK_VERSION (3, 10, 0)
|
||||||
scale = gdk_screen_get_monitor_scale_factor (gscreen, i);
|
scale = gdk_screen_get_monitor_scale_factor (gscreen, i);
|
||||||
#endif
|
#endif
|
||||||
rec.width *= scale;
|
rec.width *= scale;
|
||||||
|
|
|
@ -10310,7 +10310,9 @@ void
|
||||||
x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
|
x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
|
||||||
{
|
{
|
||||||
int modified_top, modified_left;
|
int modified_top, modified_left;
|
||||||
|
#ifdef USE_GTK
|
||||||
int scale = xg_get_scale (f);
|
int scale = xg_get_scale (f);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (change_gravity > 0)
|
if (change_gravity > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue