From a4a243cee4cef10b32fafc9d646cd5d2b7d75ec7 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 28 Aug 2017 17:45:42 +0200 Subject: [PATCH] display: Round scaled logical monitor sizes the same way mutter does Mutter uses round() while we are just truncating via the implicit double -> int type conversion, meaning that mutter will reject some configurations that should work. Fix that by using the same rounding as mutter. https://bugzilla.gnome.org/show_bug.cgi?id=786919 --- panels/display/cc-display-config-dbus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c index 16c1927b9..48e0145ee 100644 --- a/panels/display/cc-display-config-dbus.c +++ b/panels/display/cc-display-config-dbus.c @@ -17,6 +17,7 @@ * */ +#include #include #include "cc-display-config-dbus.h" @@ -1539,7 +1540,7 @@ logical_monitor_width (CcDisplayLogicalMonitor *lm) width = mode ? mode->width : 0; if (monitor->config->layout_mode == CC_DISPLAY_LAYOUT_MODE_LOGICAL) - return width / lm->scale; + return round (width / lm->scale); else return width; } @@ -1569,7 +1570,7 @@ logical_monitor_height (CcDisplayLogicalMonitor *lm) height = mode ? mode->height : 0; if (monitor->config->layout_mode == CC_DISPLAY_LAYOUT_MODE_LOGICAL) - return height / lm->scale; + return round (height / lm->scale); else return height; }