aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-09 06:46:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-09 06:46:25 +0000
commitfc9fde88c3ea2f9a5d4923229df146d3b96bab9f (patch)
treedd6ee59f1091a9192576de928a60f749ec1f51e8 /terminal.c
parentwayland: log: be clear that these are the XCRUSOR_* environment variables (diff)
input: only call term_kbd_focus_{in,out}() on actual state change
That is, only call term_kbd_focus_in() if we're the *first* seat focusing that terminal, and only call term_kbd_focus_out() if we're the *last* seat that focused it.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index e4197a2a..fa1816ae 100644
--- a/terminal.c
+++ b/terminal.c
@@ -1964,6 +1964,8 @@ term_has_kbd_focus(struct terminal *term)
void
term_kbd_focus_in(struct terminal *term)
{
+ assert(term_has_kbd_focus(term));
+
if (term->focus_events)
term_to_slave(term, "\033[I", 3);
}
@@ -1971,6 +1973,8 @@ term_kbd_focus_in(struct terminal *term)
void
term_kbd_focus_out(struct terminal *term)
{
+ assert(!term_has_kbd_focus(term));
+
if (term->focus_events)
term_to_slave(term, "\033[O", 3);
}