summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-04-30 00:30:53 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-04-30 00:30:53 +0000
commit9aa40d0e58b04ad76d1dcbe9e84a6fb905dea0db (patch)
tree7109cce4fa77e3ca6929d0afef388c0fa73f8ca1 /src
parent91882b1a2b49b0aba84fcfb123310a2346d5e9e5 (diff)
downloadirssi-9aa40d0e58b04ad76d1dcbe9e84a6fb905dea0db.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/window-items.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fe-common/core/window-items.c b/src/fe-common/core/window-items.c
index e53e5a1d..7d0b98d1 100644
--- a/src/fe-common/core/window-items.c
+++ b/src/fe-common/core/window-items.c
@@ -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;