mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
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.
This commit is contained in:
parent
98f3ccfe79
commit
fc9fde88c3
2 changed files with 24 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue