summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-09 14:03:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-09 14:03:44 +0000
commit6a1f6b560ff2e831d2f5156484c3c690800f7c84 (patch)
treef10922e315e148172020a7129286cf366dbdafb1 /src
parentac8109ac9e4c72b87cd17759e92b010eac61fa4f (diff)
downloadirssi-6a1f6b560ff2e831d2f5156484c3c690800f7c84.zip
Still some window closing bugs/crashes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2225 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/mainwindows.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c
index 14af4048..60fd3de9 100644
--- a/src/fe-text/mainwindows.c
+++ b/src/fe-text/mainwindows.c
@@ -129,7 +129,7 @@ static GSList *get_sticky_windows_sorted(MAIN_WINDOW_REC *mainwin)
void mainwindow_change_active(MAIN_WINDOW_REC *mainwin,
WINDOW_REC *skip_window)
{
- WINDOW_REC *window;
+ WINDOW_REC *window, *other;
GSList *tmp;
mainwin->active = NULL;
@@ -149,16 +149,21 @@ void mainwindow_change_active(MAIN_WINDOW_REC *mainwin,
}
}
+ other = NULL;
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data;
- if (rec != skip_window && WINDOW_MAIN(rec) != mainwin) {
- window_set_active(rec);
- break;
+ if (rec != skip_window) {
+ if (WINDOW_MAIN(rec) == mainwin) {
+ window_set_active(rec);
+ return;
+ }
+ other = rec;
}
}
- /* no more non-sticky windows, remove main window */
+ /* no more non-sticky windows, remove main window */
+ window_set_active(other);
mainwindow_destroy(mainwin);
}