diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c index 5ff4fd0fe..81abb65f3 100644 --- a/src/backends/meta-monitor-config-manager.c +++ b/src/backends/meta-monitor-config-manager.c @@ -981,8 +981,10 @@ meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor switch (layout_mode) { case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: - expected_mode_width *= logical_monitor_config->scale; - expected_mode_height *= logical_monitor_config->scale; + expected_mode_width = roundf (expected_mode_width * + logical_monitor_config->scale); + expected_mode_height = roundf (expected_mode_height * + logical_monitor_config->scale); break; case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: break; diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c index aa0310b0b..6ed19432a 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c @@ -453,8 +453,8 @@ derive_logical_monitor_layout (MetaLogicalMonitorConfig *logical_monitor_conf switch (layout_mode) { case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: - width /= logical_monitor_config->scale; - height /= logical_monitor_config->scale; + width = roundf (width / logical_monitor_config->scale); + height = roundf (height / logical_monitor_config->scale); break; case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: break; diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index aed46049e..099a48e74 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1968,8 +1968,8 @@ derive_logical_monitor_size (MetaMonitorConfig *monitor_config, switch (layout_mode) { case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: - width /= scale; - height /= scale; + width = roundf (width / scale); + height = roundf (height / scale); break; case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: break;