mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
input: don’t assert when receiving a button release without a press event
This commit is contained in:
parent
b4d7a60864
commit
9d8ca321d6
1 changed files with 20 additions and 1 deletions
21
input.c
21
input.c
|
|
@ -1537,6 +1537,11 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
|
|||
assert(it->item.button != button);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Remember which surface "owns" this button, so that we can
|
||||
* send motion and button release events to that surface, even
|
||||
* if the pointer is no longer over it.
|
||||
*/
|
||||
tll_push_back(
|
||||
seat->mouse.buttons,
|
||||
((struct button_tracker){
|
||||
|
|
@ -1559,7 +1564,21 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
|
|||
break;
|
||||
}
|
||||
}
|
||||
assert(have_button);
|
||||
|
||||
if (!have_button) {
|
||||
/*
|
||||
* Seen on Sway with slurp
|
||||
*
|
||||
* 1. Run slurp
|
||||
* 2. Press, and hold left mouse button
|
||||
* 3. Press escape, to cancel slurp
|
||||
* 4. Release mouse button
|
||||
* 5. BAM!
|
||||
*/
|
||||
LOG_WARN("stray button release event");
|
||||
return;
|
||||
}
|
||||
|
||||
seat->mouse.last_released_button = button;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue