diff options
author | Timo Sirainen <cras@irssi.org> | 2001-09-09 12:12:28 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-09-09 12:12:28 +0000 |
commit | 8e3005a1c1b6e9674208d01662b89cc3e1ffa4f9 (patch) | |
tree | 0a44001951752747ad689d9c37c7eb08673185d8 /src/fe-text | |
parent | 5c45593f024cae0411550e898b77d800396f47ec (diff) | |
download | irssi-8e3005a1c1b6e9674208d01662b89cc3e1ffa4f9.zip |
/WINDOW MOVE UP|DOWN might have crashed.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1780 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/mainwindows.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index d3a3c8fd..6c8a02c8 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -108,15 +108,24 @@ 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; GSList *tmp; mainwin->active = NULL; if (mainwin->sticky_windows) { /* sticky window */ tmp = get_sticky_windows_sorted(mainwin); - window_set_active(tmp->data); + window = tmp->data; + if (window == skip_window) { + window = tmp->next == NULL ? NULL : + tmp->next->data; + } g_slist_free(tmp); - return; + + if (window != NULL) { + window_set_active(window); + return; + } } for (tmp = windows; tmp != NULL; tmp = tmp->next) { @@ -129,7 +138,7 @@ void mainwindow_change_active(MAIN_WINDOW_REC *mainwin, } /* no more non-sticky windows, remove main window */ - mainwindow_destroy(mainwin); + mainwindow_destroy(mainwin); } void mainwindows_recreate(void) @@ -814,11 +823,18 @@ static void window_reparent(WINDOW_REC *win, MAIN_WINDOW_REC *mainwin) old_mainwin = WINDOW_MAIN(win); if (old_mainwin != mainwin) { - gui_window_reparent(win, mainwin); - window_set_active(win); + gui_window_set_unsticky(win); - if (old_mainwin->active == win) + if (old_mainwin->active == win) { mainwindow_change_active(old_mainwin, win); + if (active_mainwin == NULL) { + active_mainwin = mainwin; + window_set_active(mainwin->active); + } + } + + gui_window_reparent(win, mainwin); + window_set_active(win); } } @@ -890,7 +906,7 @@ static void cmd_window_move_up(void) MAIN_WINDOW_REC *rec; rec = mainwindows_find_upper(active_mainwin->first_line); - if (rec != NULL) + if (rec != NULL) window_reparent(active_win, rec); } |