mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-11 05:33:55 -04:00
input: only cancel selection on left mouse button clicks
This commit is contained in:
parent
ea2897582f
commit
210c0ee5cd
1 changed files with 3 additions and 4 deletions
7
input.c
7
input.c
|
|
@ -1175,6 +1175,8 @@ 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: {
|
||||||
if (button == BTN_LEFT) {
|
if (button == BTN_LEFT) {
|
||||||
|
selection_cancel(term);
|
||||||
|
|
||||||
switch (wayl->mouse.count) {
|
switch (wayl->mouse.count) {
|
||||||
case 1:
|
case 1:
|
||||||
selection_start(
|
selection_start(
|
||||||
|
|
@ -1211,7 +1213,6 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
|
||||||
execute_binding(term, binding->action, serial);
|
execute_binding(term, binding->action, serial);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
selection_cancel(term);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
term_mouse_down(term, button, wayl->mouse.row, wayl->mouse.col);
|
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:
|
case WL_POINTER_BUTTON_STATE_RELEASED:
|
||||||
if (button != BTN_LEFT || term->selection.end.col == -1)
|
if (button == BTN_LEFT && term->selection.end.col != -1)
|
||||||
selection_cancel(term);
|
|
||||||
else
|
|
||||||
selection_finalize(term, serial);
|
selection_finalize(term, serial);
|
||||||
|
|
||||||
term_mouse_up(term, button, wayl->mouse.row, wayl->mouse.col);
|
term_mouse_up(term, button, wayl->mouse.row, wayl->mouse.col);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue