aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-30 16:06:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-30 16:06:15 +0000
commit2208f4304b799dbaaf52629d8ef3ce5629f16184 (patch)
treecc4f6af105e2ef33919c95d090ca87dc6c9ffc5a /selection.c
parentcommands: scrollback: don't scrollback if mouse tracking is enabled (diff)
term: add term_mouse_grabbed()
When this returns true, it means we have keyboard focus and are grabbing the mouse (for e.g. selections), regardless of whether the client has enabled mouse tracking or not.
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/selection.c b/selection.c
index 8aa97e13..b77dc64a 100644
--- a/selection.c
+++ b/selection.c
@@ -21,23 +21,12 @@
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
-static bool
-selection_forced(const struct terminal *term)
-{
- const struct wayland *wayl = term->wl;
- return wayl->focused == term &&
- wayl->kbd.shift &&
- !wayl->kbd.alt &&
- !wayl->kbd.ctrl &&
- !wayl->kbd.meta;
-}
-
bool
selection_enabled(const struct terminal *term)
{
return
term->mouse_tracking == MOUSE_NONE ||
- selection_forced(term) ||
+ term_mouse_grabbed(term) ||
term->is_searching;
}