diff options
-rw-r--r-- | src/fe-common/core/window-items.c | 8 |
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; |