From 77d0b2a140d2a4421362bb875c1b714867d8e5b8 Mon Sep 17 00:00:00 2001 From: Mariano Abad Date: Mon, 31 Aug 2026 19:24:58 -0300 Subject: [PATCH] fix(linux): read output positions from xdg-output on wlroots wl_output.geometry carries (0, 0) for every output on wlroots compositors; the real layout is published through xdg-output only. Reading location from wl_output therefore stacks every monitor on the origin, so the desktop rect collapses to the widest single output and the uinput range never reaches a monitor that sits to the right of the first one. Measured on sway 1.11: wl_output reports x=0 for both DP-6 and eDP-1 while xdg-output reports 0 and 1920; the uinput range came out 1920x1080 instead of the 3360x1080 desktop. Mutter fills both, so GNOME is unchanged. --- src/platform/linux.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 5ae180c..6332743 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -467,7 +467,11 @@ fn collect_wayland_displays(conn: &Connection) -> ResultType() { output_data.with_output_info(|info| { if let Some(mode) = info.modes.iter().find(|m| m.current) { - let (x, y) = info.location; + // wlroots compositors leave wl_output.geometry at (0, 0) for every output and + // publish the real layout only through xdg-output, so taking `location` there + // stacks the whole desktop on the origin. Mutter fills both, so this stays a + // no-op on GNOME. + let (x, y) = info.logical_position.unwrap_or(info.location); let (width, height) = mode.dimensions; let refresh_rate = mode.refresh_rate; let name = info.name.clone().unwrap_or_default();