diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-06-23 13:10:46 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2013-06-28 20:55:16 +0100 |
commit | c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa (patch) | |
tree | 3a746b9f737616e49e490ce555df0655e7952bcc /tty.c | |
parent | 777be296ee041e7d9131110e0489e791ed389ac1 (diff) | |
download | rtmux-c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa.tar.gz rtmux-c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa.tar.bz2 rtmux-c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa.zip |
Focus events can cause trouble if left on and they can't be turned off
during idle periods (like the other states are) because we'd miss
events. So add a server option to control them. Defaults to off.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -219,8 +219,13 @@ tty_start_tty(struct tty *tty) if (tty_term_has(tty->term, TTYC_KMOUS)) tty_puts(tty, "\033[?1000l\033[?1006l\033[?1005l"); - if (tty_term_has(tty->term, TTYC_XT)) + if (tty_term_has(tty->term, TTYC_XT)) { + if (options_get_number(&global_options, "focus-events")) { + tty->flags |= TTY_FOCUS; + tty_puts(tty, "\033[?1004h"); + } tty_puts(tty, "\033[c\033[>4;1m\033[m"); + } tty->cx = UINT_MAX; tty->cy = UINT_MAX; @@ -282,8 +287,13 @@ tty_stop_tty(struct tty *tty) if (tty_term_has(tty->term, TTYC_KMOUS)) tty_raw(tty, "\033[?1000l\033[?1006l\033[?1005l"); - if (tty_term_has(tty->term, TTYC_XT)) + if (tty_term_has(tty->term, TTYC_XT)) { + if (tty->flags & TTY_FOCUS) { + tty->flags &= ~TTY_FOCUS; + tty_puts(tty, "\033[?1004l"); + } tty_raw(tty, "\033[>4m\033[m"); + } tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP)); |