input: regression: don’t pass on mouse click to application if we consumed it

When we ‘consume’ a mouse button event (i.e. when we have a shortcut
mapped to it), the event should *not* be passed on to the client
application.

In 5f64c5c335, button handling was
refactored and unfortunately introduced a regression where we once
again started passing consumed button presses to the client
application.

Fixes #168
This commit is contained in:
Daniel Eklöf 2020-10-13 08:02:09 +02:00
parent 2f20550893
commit fdb7e40355
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 18 additions and 7 deletions

View file

@ -1,5 +1,6 @@
# Changelog # Changelog
* [1.5.2](#1-5-2)
* [1.5.1](#1-5-1) * [1.5.1](#1-5-1)
* [1.5.0](#1-5-0) * [1.5.0](#1-5-0)
* [1.4.4](#1-4-4) * [1.4.4](#1-4-4)
@ -14,6 +15,14 @@
* [1.2.0](#1-2-0) * [1.2.0](#1-2-0)
## 1.5.2
### Fixed
* Regression: middle clicking double pastes in e.g. vim
(https://codeberg.org/dnkl/foot/issues/168)
## 1.5.1 ## 1.5.1
### Changed ### Changed

16
input.c
View file

@ -1589,13 +1589,15 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
} }
} }
if (!term_mouse_grabbed(term, seat) && }
cursor_is_on_grid)
{ if (!seat->mouse.consumed &&
term_mouse_down( !term_mouse_grabbed(term, seat) &&
term, button, seat->mouse.row, seat->mouse.col, cursor_is_on_grid)
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl); {
} term_mouse_down(
term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
} }
break; break;
} }