diff options
| author | Robert Pluim | 2018-01-24 20:08:35 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2018-01-24 20:08:35 +0100 |
| commit | 1412cf3edd65103649cd7318c39ee4adeea43416 (patch) | |
| tree | b1fd585861ea6eaf363ddfebfbea3b64119ee53f | |
| parent | 59db8dca030ba6a34d143c3cc6715f02beba1068 (diff) | |
| download | emacs-1412cf3edd65103649cd7318c39ee4adeea43416.tar.gz emacs-1412cf3edd65103649cd7318c39ee4adeea43416.zip | |
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.
| -rw-r--r-- | src/xfns.c | 4 | ||||
| -rw-r--r-- | 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. */) | |||
| 4940 | gint width_mm = -1, height_mm = -1; | 4940 | gint width_mm = -1, height_mm = -1; |
| 4941 | GdkRectangle rec, work; | 4941 | GdkRectangle rec, work; |
| 4942 | struct MonitorInfo *mi = &monitors[i]; | 4942 | struct MonitorInfo *mi = &monitors[i]; |
| 4943 | int scale; | 4943 | int scale = 1; |
| 4944 | 4944 | ||
| 4945 | #if GTK_CHECK_VERSION (3, 22, 0) | 4945 | #if GTK_CHECK_VERSION (3, 22, 0) |
| 4946 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); | 4946 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); |
| @@ -4989,7 +4989,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 4989 | /* GTK returns scaled sizes for the workareas. */ | 4989 | /* GTK returns scaled sizes for the workareas. */ |
| 4990 | #if GTK_CHECK_VERSION (3, 22, 0) | 4990 | #if GTK_CHECK_VERSION (3, 22, 0) |
| 4991 | scale = gdk_monitor_get_scale_factor (monitor); | 4991 | scale = gdk_monitor_get_scale_factor (monitor); |
| 4992 | #else | 4992 | #elif GTK_CHECK_VERSION (3, 10, 0) |
| 4993 | scale = gdk_screen_get_monitor_scale_factor (gscreen, i); | 4993 | scale = gdk_screen_get_monitor_scale_factor (gscreen, i); |
| 4994 | #endif | 4994 | #endif |
| 4995 | rec.width *= scale; | 4995 | 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 | |||
| 10310 | x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) | 10310 | x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) |
| 10311 | { | 10311 | { |
| 10312 | int modified_top, modified_left; | 10312 | int modified_top, modified_left; |
| 10313 | #ifdef USE_GTK | ||
| 10313 | int scale = xg_get_scale (f); | 10314 | int scale = xg_get_scale (f); |
| 10315 | #endif | ||
| 10314 | 10316 | ||
| 10315 | if (change_gravity > 0) | 10317 | if (change_gravity > 0) |
| 10316 | { | 10318 | { |