mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
seat: only store serial if pressing a button
The grab serial can be used to start a pointer grab. A button pressed event should be used for this purpose. Thus, we should only save the grab serial if it's the first button pressed event we send. This commit makes it so the serial is not saved if a button is released while another button is still pressed.
This commit is contained in:
parent
2fde5c95d8
commit
e8f012c993
1 changed files with 2 additions and 1 deletions
|
@ -356,7 +356,8 @@ uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
|
||||||
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
|
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
|
||||||
uint32_t serial = grab->interface->button(grab, time, button, state);
|
uint32_t serial = grab->interface->button(grab, time, button, state);
|
||||||
|
|
||||||
if (serial && wlr_seat->pointer_state.button_count == 1) {
|
if (serial && wlr_seat->pointer_state.button_count == 1 &&
|
||||||
|
state == WL_POINTER_BUTTON_STATE_PRESSED) {
|
||||||
wlr_seat->pointer_state.grab_serial = serial;
|
wlr_seat->pointer_state.grab_serial = serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue