summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authornicm <nicm>2014-10-22 23:11:41 +0000
committernicm <nicm>2014-10-22 23:11:41 +0000
commit68cb1c0e6b169c6765e0d52c5319fe4354edaf09 (patch)
tree1a7c7b8d6de53c3afc13120b439eeedb4d3b1a89 /session.c
parenta02c2e55c0ee0a6f2d3a897c06a396794b765a6c (diff)
Merge unlink-window into kill-window.
Diffstat (limited to 'session.c')
-rw-r--r--session.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/session.c b/session.c
index 3bc2363e..0f8c1122 100644
--- a/session.c
+++ b/session.c
@@ -492,6 +492,19 @@ session_group_remove(struct session *s)
}
}
+/* Count number of sessions in session group. */
+u_int
+session_group_count(struct session_group *sg)
+{
+ struct session *s;
+ u_int n;
+
+ n = 0;
+ TAILQ_FOREACH(s, &sg->sessions, gentry)
+ n++;
+ return (n);
+}
+
/* Synchronize a session to its session group. */
void
session_group_synchronize_to(struct session *s)
@@ -579,8 +592,9 @@ session_group_synchronize1(struct session *target, struct session *s)
/* Then free the old winlinks list. */
while (!RB_EMPTY(&old_windows)) {
wl = RB_ROOT(&old_windows);
- if (winlink_find_by_window_id(&s->windows, wl->window->id) == NULL)
- notify_window_unlinked(s, wl->window);
+ wl2 = winlink_find_by_window_id(&s->windows, wl->window->id);
+ if (wl2 == NULL)
+ notify_window_unlinked(s, wl->window);
winlink_remove(&old_windows, wl);
}
}