From e29d66f1deeb410c61e892e12e94e9971e645320 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Wed, 1 May 2024 15:25:06 +0200 Subject: [PATCH] Xwayland: disallow negative output coordinates Xwayland clients on outputs at negative positions don't currently receive mouse events due to a bug in Xwayland. As a workaround, we disallow negative output positions when Xwayland is enabled. References: https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 Closes: #1058 --- river/Root.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/river/Root.zig b/river/Root.zig index 258129d..6d2dd8f 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -814,6 +814,19 @@ fn processOutputConfig( var proposed_state = wlr.Output.State.init(); head.state.apply(&proposed_state); + // Negative output coordinates currently cause Xwayland clients to not receive click events. + // See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 + if (build_options.xwayland and server.xwayland != null and + (head.state.x < 0 or head.state.y < 0)) + { + std.log.scoped(.output_manager).err( + \\Attempted to set negative coordinates for output {s}. + \\Negative output coordinates are disallowed if Xwayland is enabled due to a limitation of Xwayland. + , .{output.wlr_output.name}); + success = false; + continue; + } + switch (action) { .test_only => { if (!wlr_output.testState(&proposed_state)) success = false;