TextInput: fix consecutive enable requests
The wording of the text-input-v3 protocol is quite confusing here but I'm pretty sure this is now correct.
This commit is contained in:
parent
6f311af3b3
commit
40920c7818
@ -66,10 +66,15 @@ fn handleEnable(listener: *wl.Listener(*wlr.TextInputV3), _: *wlr.TextInputV3) v
|
|||||||
const text_input = @fieldParentPtr(TextInput, "enable", listener);
|
const text_input = @fieldParentPtr(TextInput, "enable", listener);
|
||||||
const seat: *Seat = @ptrFromInt(text_input.wlr_text_input.seat.data);
|
const seat: *Seat = @ptrFromInt(text_input.wlr_text_input.seat.data);
|
||||||
|
|
||||||
if (seat.relay.text_input != null) {
|
// The same text_input object may be enabled multiple times consecutively
|
||||||
|
// without first disabling it. Enabling a different text input object without
|
||||||
|
// first disabling the current one is disallowed by the protocol however.
|
||||||
|
if (seat.relay.text_input) |currently_enabled| {
|
||||||
|
if (text_input != currently_enabled) {
|
||||||
log.err("client requested to enable more than one text input on a single seat, ignoring request", .{});
|
log.err("client requested to enable more than one text input on a single seat, ignoring request", .{});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
seat.relay.text_input = text_input;
|
seat.relay.text_input = text_input;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user