mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-17 06:59:43 -05:00
seat/pointer: reset pressed buttons on focus change
This fixes two problems:
- A surface could get unexpected release events for buttons pressed
while other surface was focused;
- Clearing focus while a button is pressed would lead to the button
getting "stuck".
Fixes: 8730ca9661
This commit is contained in:
parent
0a388a14f1
commit
08e779bd85
1 changed files with 3 additions and 0 deletions
|
|
@ -179,6 +179,9 @@ void wlr_seat_pointer_enter(struct wlr_seat *wlr_seat,
|
||||||
seat_client_send_pointer_leave_raw(focused_client, focused_surface);
|
seat_client_send_pointer_leave_raw(focused_client, focused_surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The current surface doesn't know about pressed buttons
|
||||||
|
wlr_seat->pointer_state.button_count = 0;
|
||||||
|
|
||||||
// enter the current surface
|
// enter the current surface
|
||||||
if (client != NULL && surface != NULL) {
|
if (client != NULL && surface != NULL) {
|
||||||
uint32_t serial = wlr_seat_client_next_serial(client);
|
uint32_t serial = wlr_seat_client_next_serial(client);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue