X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Ffe-text%2Fmainwindows.c;h=03fdeda86b06c4c5e71751aac52c4a62aa76f9ee;hb=63ca577177f9f5db8e553372a9793b0c85f10715;hp=03a8270512a0f2070a356c9b4a10e69e52b3c846;hpb=60c165f23f8d5553bd8b4fd43366fbf5f24c2832;p=silc.git diff --git a/apps/irssi/src/fe-text/mainwindows.c b/apps/irssi/src/fe-text/mainwindows.c index 03a82705..03fdeda8 100644 --- a/apps/irssi/src/fe-text/mainwindows.c +++ b/apps/irssi/src/fe-text/mainwindows.c @@ -154,17 +154,14 @@ void mainwindow_change_active(MAIN_WINDOW_REC *mainwin, WINDOW_REC *rec = tmp->data; if (rec != skip_window) { - if (WINDOW_MAIN(rec) == mainwin) { - window_set_active(rec); - return; - } - other = rec; + other = rec; + break; } } - /* no more non-sticky windows, remove main window */ window_set_active(other); - mainwindow_destroy(mainwin); + if (mainwindows->next != NULL) + mainwindow_destroy(mainwin); } void mainwindows_recreate(void) @@ -304,11 +301,13 @@ void mainwindow_destroy(MAIN_WINDOW_REC *window) term_window_destroy(window->screen_win); - if (!quitting && mainwindows != NULL) { + if (mainwindows != NULL) { gui_windows_remove_parent(window); - mainwindows_add_space(window->first_line, window->last_line); - - mainwindows_redraw(); + if (!quitting) { + mainwindows_add_space(window->first_line, + window->last_line); + mainwindows_redraw(); + } } g_free(window);