mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-03 07:15:29 -04:00
input: don't paste from primary if client is mouse tracking
This commit is contained in:
parent
356c5a28b5
commit
70b6d9d7d2
3 changed files with 3 additions and 2 deletions
2
input.c
2
input.c
|
|
@ -433,7 +433,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (term->mouse.count == 1 && button == BTN_MIDDLE)
|
if (term->mouse.count == 1 && button == BTN_MIDDLE && selection_enabled(term))
|
||||||
selection_from_primary(term);
|
selection_from_primary(term);
|
||||||
selection_cancel(term);
|
selection_cancel(term);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
#define min(x, y) ((x) < (y) ? (x) : (y))
|
#define min(x, y) ((x) < (y) ? (x) : (y))
|
||||||
#define max(x, y) ((x) > (y) ? (x) : (y))
|
#define max(x, y) ((x) > (y) ? (x) : (y))
|
||||||
|
|
||||||
static bool
|
bool
|
||||||
selection_enabled(const struct terminal *term)
|
selection_enabled(const struct terminal *term)
|
||||||
{
|
{
|
||||||
return term->mouse_tracking == MOUSE_NONE || term->kbd.shift;
|
return term->mouse_tracking == MOUSE_NONE || term->kbd.shift;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
extern const struct wl_data_device_listener data_device_listener;
|
extern const struct wl_data_device_listener data_device_listener;
|
||||||
extern const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener;
|
extern const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener;
|
||||||
|
|
||||||
|
bool selection_enabled(const struct terminal *term);
|
||||||
void selection_start(struct terminal *term, int col, int row);
|
void selection_start(struct terminal *term, int col, int row);
|
||||||
void selection_update(struct terminal *term, int col, int row);
|
void selection_update(struct terminal *term, int col, int row);
|
||||||
void selection_finalize(struct terminal *term, uint32_t serial);
|
void selection_finalize(struct terminal *term, uint32_t serial);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue