summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 43c55cca643..92cd12be164 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4938,6 +4938,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 = 1;
#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i);
@@ -4983,6 +4984,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
}
#endif
+ /* GTK returns scaled sizes for the workareas. */
+#if GTK_CHECK_VERSION (3, 22, 0)
+ scale = gdk_monitor_get_scale_factor (monitor);
+#elif GTK_CHECK_VERSION (3, 10, 0)
+ scale = gdk_screen_get_monitor_scale_factor (gscreen, i);
+#endif
+ rec.width *= scale;
+ rec.height *= scale;
+ work.width *= scale;
+ work.height *= scale;
mi->geom.x = rec.x;
mi->geom.y = rec.y;