Change information
Commit message:
[Wayland] Fix GnomeDisplayConfig logical size rounding error
GnomeDisplayConfig::GetLayoutSize() calculated logical monitor sizes
using truncation (implicit double-to-int conversion). For scaled
displays (e.g., 3840 width at 1.333... scale), this yields 2879 DIPs
instead of Mutter's rounded 2880 DIPs.
During Relayout(), the host packs adjacent monitors, positioning the
second monitor at x=2879. Mutter detects a 1px overlap with the first
monitor (which is 2880 wide) and rejects the layout with "Logical
monitors not adjacent".
This CL fixes the bug by wrapping the division in base::ClampRound(),
which safely rounds to the nearest integer and prevents potential
overflows, aligning the host's logical size calculation with Mutter's.
TAG=agy
CONV=982f94ac-ba44-429f-a544-432d0bc66b83
(cherry picked from commit fb369fcefde810fc03fef19edaece7b1db6754c1)
Bug: 514449607,514435889
Change-Id: I25c697a3fc434a9caf77bb3f01664cfddfa9e5a9
Cr-Original-Commit-Position: refs/heads/main@{#1632503}
Cr-Commit-Position: refs/branch-heads/7827@{#1100}
Cr-Branched-From: 9f3e9aaccba63bd2ec30334e45e0bfd07ebcc8f1-refs/heads/main@{#1625079}
Files:
- M remoting/host/linux/gnome_display_config.cc
Change size: XS
Delta: 1 file changed, 4 insertions(+), 2 deletions(-)
Branch: refs/branch-heads/7827