From ed3535db8a5dac03cab96f7fc220b99095423fd0 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Mon, 31 Aug 2009 22:30:15 +0000 Subject: Sync OpenBSD patchset 302: 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. --- server-fn.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'server-fn.c') diff --git a/server-fn.c b/server-fn.c index d01c8ab4..74c18a4e 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.81 2009-08-14 21:04:04 tcunha Exp $ */ +/* $Id: server-fn.c,v 1.82 2009-08-31 22:30:15 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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); + } +} -- cgit