summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2016-10-15 00:12:58 +0000
committernicm <nicm>2016-10-15 00:12:58 +0000
commit3f138dc40c37ddee021b92e5d29676ed96b6cab8 (patch)
treeefbe5f7d5c6ff93b807629f3257fb424094eb8c8
parent63b2547a0255c42bff405ca34577de240a99b736 (diff)
Rename a function for consistency and some spacing nits.
-rw-r--r--control-notify.c2
-rw-r--r--notify.c2
-rw-r--r--session.c6
-rw-r--r--tmux.h2
4 files changed, 8 insertions, 4 deletions
diff --git a/control-notify.c b/control-notify.c
index c28d0fc8..e544139b 100644
--- a/control-notify.c
+++ b/control-notify.c
@@ -196,7 +196,7 @@ control_notify_session_created(__unused struct session *s)
}
void
-control_notify_session_close(__unused struct session *s)
+control_notify_session_closed(__unused struct session *s)
{
struct client *c;
diff --git a/notify.c b/notify.c
index 5f4f046e..416b81f6 100644
--- a/notify.c
+++ b/notify.c
@@ -147,7 +147,7 @@ notify_drain(void)
control_notify_session_created(ne->session);
break;
case NOTIFY_SESSION_CLOSED:
- control_notify_session_close(ne->session);
+ control_notify_session_closed(ne->session);
break;
}
TAILQ_REMOVE(&notify_queue, ne, entry);
diff --git a/session.c b/session.c
index 634f89d9..423b7db1 100644
--- a/session.c
+++ b/session.c
@@ -211,6 +211,7 @@ session_destroy(struct session *s)
struct winlink *wl;
log_debug("session %s destroyed", s->name);
+ s->curw = NULL;
RB_REMOVE(sessions, &sessions, s);
notify_session_closed(s);
@@ -385,14 +386,17 @@ int
session_detach(struct session *s, struct winlink *wl)
{
if (s->curw == wl &&
- session_last(s) != 0 && session_previous(s, 0) != 0)
+ session_last(s) != 0 &&
+ session_previous(s, 0) != 0)
session_next(s, 0);
wl->flags &= ~WINLINK_ALERTFLAGS;
notify_window_unlinked(s, wl->window);
winlink_stack_remove(&s->lastw, wl);
winlink_remove(&s->windows, wl);
+
session_group_synchronize_from(s);
+
if (RB_EMPTY(&s->windows)) {
session_destroy(s);
return (1);
diff --git a/tmux.h b/tmux.h
index 0db6f031..00d08016 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2208,7 +2208,7 @@ void control_notify_window_renamed(struct window *);
void control_notify_attached_session_changed(struct client *);
void control_notify_session_renamed(struct session *);
void control_notify_session_created(struct session *);
-void control_notify_session_close(struct session *);
+void control_notify_session_closed(struct session *);
/* session.c */
extern struct sessions sessions;