diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index dd3b36c1330..4ea5113265b 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4940,6 +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 | 4944 | ||
| 4944 | #if GTK_CHECK_VERSION (3, 22, 0) | 4945 | #if GTK_CHECK_VERSION (3, 22, 0) |
| 4945 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); | 4946 | GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); |
| @@ -4985,6 +4986,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 4985 | } | 4986 | } |
| 4986 | #endif | 4987 | #endif |
| 4987 | 4988 | ||
| 4989 | /* GTK returns scaled sizes for the workareas. */ | ||
| 4990 | #if GTK_CHECK_VERSION (3, 22, 0) | ||
| 4991 | scale = gdk_monitor_get_scale_factor (monitor); | ||
| 4992 | #else | ||
| 4993 | scale = gdk_screen_get_monitor_scale_factor (gscreen, i); | ||
| 4994 | #endif | ||
| 4995 | rec.width *= scale; | ||
| 4996 | rec.height *= scale; | ||
| 4997 | work.width *= scale; | ||
| 4998 | work.height *= scale; | ||
| 4988 | 4999 | ||
| 4989 | mi->geom.x = rec.x; | 5000 | mi->geom.x = rec.x; |
| 4990 | mi->geom.y = rec.y; | 5001 | mi->geom.y = rec.y; |