1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

keep the window items sorted in window->items list, based on when they were

last active (just like windows list)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2741 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-04-30 00:30:53 +00:00 committed by cras
parent 91882b1a2b
commit 9aa40d0e58

View File

@ -50,7 +50,7 @@ void window_item_add(WINDOW_REC *window, WI_ITEM_REC *item, int automatic)
window_set_active(window);
}
window->items = g_slist_append(window->items, item);
window->items = g_slist_prepend(window->items, item);
signal_emit("window item new", 2, window, item);
if (g_slist_length(window->items) == 1 ||
@ -112,7 +112,11 @@ void window_item_set_active(WINDOW_REC *window, WI_ITEM_REC *item)
/* move item to different window */
window_item_remove(item);
window_item_add(window, item, FALSE);
}
} else if (item != NULL) {
/* reorder the window item stack */
window->items = g_slist_remove(window->items, item);
window->items = g_slist_prepend(window->items, item);
}
if (window->active != item) {
window->active = item;