input: fix assertion when pressing first one mouse button, then another

This commit is contained in:
Daniel Eklöf 2020-09-07 19:35:25 +02:00
parent 6e4d29ef71
commit 5f64c5c335
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1493,8 +1493,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
switch (state) { switch (state) {
case WL_POINTER_BUTTON_STATE_PRESSED: { case WL_POINTER_BUTTON_STATE_PRESSED: {
assert(!seat->mouse.consumed); if (!seat->mouse.consumed) {
if (seat->wl_keyboard != NULL) { if (seat->wl_keyboard != NULL) {
/* Seat has keyboard - use mouse bindings *with* modifiers */ /* Seat has keyboard - use mouse bindings *with* modifiers */
@ -1557,14 +1556,14 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
} }
} }
if (!seat->mouse.consumed && if (!term_mouse_grabbed(term, seat) &&
!term_mouse_grabbed(term, seat) &&
cursor_is_on_grid) cursor_is_on_grid)
{ {
term_mouse_down( term_mouse_down(
term, button, seat->mouse.row, seat->mouse.col, term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl); seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
} }
}
break; break;
} }