diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-31 20:46:19 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-31 20:46:19 +0000 |
commit | 04319964b95304138dbe5cbce0b97222769d0c17 (patch) | |
tree | 3d067da0a55da208bbf9dd18d1711d5b165ffcfc /server-fn.c | |
parent | 8102ec3be55e9800837eeb2f1f9135a433452794 (diff) |
Add a new display-panes command, with two options (display-panes-colour and
display-panes-time), which displays a visual indication of the number of each
pane.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/server-fn.c b/server-fn.c index 8d5d06bd..37bf98a4 100644 --- a/server-fn.c +++ b/server-fn.c @@ -263,3 +263,32 @@ server_kill_window(struct window *w) } recalculate_sizes(); } + +void +server_set_identify(struct client *c) +{ + struct timeval tv; + int delay; + + delay = options_get_number(&c->session->options, "display-panes-time"); + tv.tv_sec = delay / 1000; + tv.tv_usec = (delay % 1000) * 1000L; + + if (gettimeofday(&c->identify_timer, NULL) != 0) + fatal("gettimeofday"); + timeradd(&c->identify_timer, &tv, &c->identify_timer); + + c->flags |= CLIENT_IDENTIFY; + c->tty.flags |= (TTY_FREEZE|TTY_NOCURSOR); + server_redraw_client(c); +} + +void +server_clear_identify(struct client *c) +{ + if (c->flags & CLIENT_IDENTIFY) { + c->flags &= ~CLIENT_IDENTIFY; + c->tty.flags &= ~(TTY_FREEZE|TTY_NOCURSOR); + server_redraw_client(c); + } +} |