From fdb7e403555df5fdcb7daf23f665bdec13b02500 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 13 Oct 2020 08:02:09 +0200 Subject: input: regression: don’t pass on mouse click to application if we consumed it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 5f64c5c33590a41afd3f621870c6abd89b859073, button handling was refactored and unfortunately introduced a regression where we once again started passing consumed button presses to the client application. Fixes #168 --- input.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 20c1381c..160c78a7 100644 --- a/input.c +++ b/input.c @@ -1589,13 +1589,15 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, } } - if (!term_mouse_grabbed(term, seat) && - cursor_is_on_grid) - { - term_mouse_down( - term, button, seat->mouse.row, seat->mouse.col, - seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl); - } + } + + if (!seat->mouse.consumed && + !term_mouse_grabbed(term, seat) && + cursor_is_on_grid) + { + term_mouse_down( + term, button, seat->mouse.row, seat->mouse.col, + seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl); } break; } -- cgit v1.3