mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-27 01:40:16 -05:00
term: disable cursor blink on unfocus, and re-enable on focus
This commit is contained in:
parent
dac31dd9c0
commit
f4e5baa123
1 changed files with 14 additions and 6 deletions
20
terminal.c
20
terminal.c
|
|
@ -1326,17 +1326,25 @@ term_restore_cursor(struct terminal *term)
|
||||||
void
|
void
|
||||||
term_focus_in(struct terminal *term)
|
term_focus_in(struct terminal *term)
|
||||||
{
|
{
|
||||||
if (!term->focus_events)
|
if (term->cursor_blink.active)
|
||||||
return;
|
cursor_blink_start_timer(term);
|
||||||
term_to_slave(term, "\033[I", 3);
|
|
||||||
|
if (term->focus_events)
|
||||||
|
term_to_slave(term, "\033[I", 3);
|
||||||
|
|
||||||
|
cursor_refresh(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_focus_out(struct terminal *term)
|
term_focus_out(struct terminal *term)
|
||||||
{
|
{
|
||||||
if (!term->focus_events)
|
if (term->cursor_blink.active)
|
||||||
return;
|
cursor_blink_stop_timer(term);
|
||||||
term_to_slave(term, "\033[O", 3);
|
|
||||||
|
if (term->focus_events)
|
||||||
|
term_to_slave(term, "\033[O", 3);
|
||||||
|
|
||||||
|
cursor_refresh(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue