From 210c0ee5cd9cdfac3a8f6430c5f5881e01bf48c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 4 Apr 2020 11:57:08 +0200 Subject: [PATCH] input: only cancel selection on left mouse button clicks --- input.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/input.c b/input.c index 4fff710f..1b1a7fff 100644 --- a/input.c +++ b/input.c @@ -1175,6 +1175,8 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, switch (state) { case WL_POINTER_BUTTON_STATE_PRESSED: { if (button == BTN_LEFT) { + selection_cancel(term); + switch (wayl->mouse.count) { case 1: selection_start( @@ -1211,7 +1213,6 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, execute_binding(term, binding->action, serial); break; } - selection_cancel(term); } term_mouse_down(term, button, wayl->mouse.row, wayl->mouse.col); @@ -1219,9 +1220,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, } case WL_POINTER_BUTTON_STATE_RELEASED: - if (button != BTN_LEFT || term->selection.end.col == -1) - selection_cancel(term); - else + if (button == BTN_LEFT && term->selection.end.col != -1) selection_finalize(term, serial); term_mouse_up(term, button, wayl->mouse.row, wayl->mouse.col);