summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-common/core/window-commands.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c
index 99af8e77..c158ba39 100644
--- a/src/fe-common/core/window-commands.c
+++ b/src/fe-common/core/window-commands.c
@@ -517,16 +517,20 @@ static void cmd_layout(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
static void cmd_foreach_window(const char *data)
{
WINDOW_REC *old;
- GSList *tmp;
+ GSList *list;
old = active_win;
- for (tmp = windows; tmp != NULL; tmp = tmp->next) {
- WINDOW_REC *rec = tmp->data;
- active_win = rec;
+ list = g_slist_copy(windows);
+ while (list != NULL) {
+ WINDOW_REC *rec = list->data;
+
+ active_win = rec;
signal_emit("send command", 3, data, rec->active_server,
rec->active);
+ list = g_slist_remove(list, list->data);
}
+
active_win = old;
}