mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
/WINDOW MOVE UP|DOWN might have crashed.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1780 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
5c45593f02
commit
8e3005a1c1
@ -108,16 +108,25 @@ 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);
|
||||
|
||||
if (window != NULL) {
|
||||
window_set_active(window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
|
||||
WINDOW_REC *rec = tmp->data;
|
||||
@ -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_set_unsticky(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);
|
||||
|
||||
if (old_mainwin->active == win)
|
||||
mainwindow_change_active(old_mainwin, win);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user