From 1412cf3edd65103649cd7318c39ee4adeea43416 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 24 Jan 2018 20:08:35 +0100 Subject: [PATCH] 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. --- src/xfns.c | 4 ++-- src/xterm.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 4ea5113265b..20fe61bffd8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4940,7 +4940,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) gint width_mm = -1, height_mm = -1; GdkRectangle rec, work; struct MonitorInfo *mi = &monitors[i]; - int scale; + int scale = 1; #if GTK_CHECK_VERSION (3, 22, 0) 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. */ #if GTK_CHECK_VERSION (3, 22, 0) scale = gdk_monitor_get_scale_factor (monitor); -#else +#elif GTK_CHECK_VERSION (3, 10, 0) scale = gdk_screen_get_monitor_scale_factor (gscreen, i); #endif rec.width *= scale; diff --git a/src/xterm.c b/src/xterm.c index f05ac6147eb..364a8a8db02 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10310,7 +10310,9 @@ void x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) { int modified_top, modified_left; +#ifdef USE_GTK int scale = xg_get_scale (f); +#endif if (change_gravity > 0) { -- 2.39.5