From 4feee126b86d59e29886407cd5c534b6e1cb2ba1 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 22 Dec 2009 10:20:08 +0000 Subject: [PATCH] Fix a couple of problems with grouped sessions reported by danh: redraw properly and choose the correct last window after a window is killed. --- server-fn.c | 6 ++---- session.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/server-fn.c b/server-fn.c index b8207ca2..df6aa134 100644 --- a/server-fn.c +++ b/server-fn.c @@ -250,10 +250,8 @@ server_kill_window(struct window *w) if (session_detach(s, wl)) server_destroy_session_group(s); - else { - server_redraw_session(s); - server_status_session_group(s); - } + else + server_redraw_session_group(s); } } diff --git a/session.c b/session.c index 457d3fd2..20656957 100644 --- a/session.c +++ b/session.c @@ -549,10 +549,10 @@ session_group_synchronize1(struct session *target, struct session *s) return; /* If the current window has vanished, move to the next now. */ - if (s->curw != NULL) { - while (winlink_find_by_index(ww, s->curw->idx) == NULL) - session_next(s, 0); - } + if (s->curw != NULL && + winlink_find_by_index(ww, s->curw->idx) == NULL && + session_last(s) != 0 && session_previous(s, 0) != 0) + session_next(s, 0); /* Save the old pointer and reset it. */ memcpy(&old_windows, &s->windows, sizeof old_windows);