mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-24 16:12:23 +00: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
@ -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…
Reference in New Issue
Block a user