input: Use seatop_down on layer surface click

This solves an issue where layer-shell items would not receive a button
release event when the pointer left them while being pressed. The
default seatop changes focus immediately while seatop_down defers any
focus changes until the pointer is released or seatop_down is destroyed.
This commit is contained in:
Simon Plakolb 2021-08-02 16:54:50 +02:00 committed by Tudor Brindus
parent 57d6f6f19e
commit 9e58425cb3
3 changed files with 31 additions and 5 deletions

View file

@ -373,6 +373,9 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
seat_set_focus_layer(seat, layer);
transaction_commit_dirty();
}
if (state == WLR_BUTTON_PRESSED) {
seatop_begin_down_on_layer_surface(seat, surface, time_msec, sx, sy);
}
seat_pointer_notify_button(seat, time_msec, button, state);
return;
}