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
This commit is contained in:
LordMZTE 2024-05-01 15:25:06 +02:00 committed by Isaac Freund
parent 5262a4c5a6
commit e29d66f1de
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -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;