summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-04-23 10:14:29 +0000
committernicm <nicm@openbsd.org>2014-04-23 10:14:29 +0000
commit3e8f9303e24fd60637bdfd4670856d22cfd3dc3a (patch)
treecb5621cd50179bcc45e27016c554a096db980a60
parentRemove krb5 bits from rc(8). (diff)
downloadwireguard-openbsd-3e8f9303e24fd60637bdfd4670856d22cfd3dc3a.tar.xz
wireguard-openbsd-3e8f9303e24fd60637bdfd4670856d22cfd3dc3a.zip
Differentiate between linked and unlinked window closes and renames,
like we already do for adds. From Andre Masella.
-rw-r--r--usr.bin/tmux/control-notify.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/tmux/control-notify.c b/usr.bin/tmux/control-notify.c
index fb25db1dd2a..14e20ea67d2 100644
--- a/usr.bin/tmux/control-notify.c
+++ b/usr.bin/tmux/control-notify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control-notify.c,v 1.8 2013/03/26 10:54:48 nicm Exp $ */
+/* $OpenBSD: control-notify.c,v 1.9 2014/04/23 10:14:29 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -99,14 +99,19 @@ void
control_notify_window_unlinked(unused struct session *s, struct window *w)
{
struct client *c;
+ struct session *cs;
u_int i;
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
+ cs = c->session;
- control_write(c, "%%window-close @%u", w->id);
+ if (winlink_find_by_window_id(&cs->windows, w->id) != NULL)
+ control_write(c, "%%window-close @%u", w->id);
+ else
+ control_write(c, "%%unlinked-window-close @%u", w->id);
}
}
@@ -134,14 +139,22 @@ void
control_notify_window_renamed(struct window *w)
{
struct client *c;
+ struct session *cs;
u_int i;
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
+ cs = c->session;
- control_write(c, "%%window-renamed @%u %s", w->id, w->name);
+ if (winlink_find_by_window_id(&cs->windows, w->id) != NULL) {
+ control_write(c, "%%window-renamed @%u %s", w->id,
+ w->name);
+ } else {
+ control_write(c, "%%unlinked-window-renamed @%u %s",
+ w->id, w->name);
+ }
}
}