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.
This commit is contained in:
Mariano Abad
2026-08-31 19:24:58 -03:00
parent 1a43eb2873
commit 77d0b2a140
+5 -1
View File
@@ -467,7 +467,11 @@ fn collect_wayland_displays(conn: &Connection) -> ResultType<Vec<WaylandDisplayI
if let Some(output_data) = output.data::<OutputData>() {
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();