From ca38f9662526919870a5207fb9952146eef10630 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Nov 2008 17:40:37 +0100 Subject: [PATCH] tag: reset client tag props on #tags change Otherwise it will be ignored on restart. Signed-off-by: Julien Danjou --- tag.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tag.c b/tag.c index ca078c78c..9be51b8fb 100644 --- a/tag.c +++ b/tag.c @@ -93,8 +93,14 @@ tag_append_to_screen(tag_t *tag, screen_t *s) ewmh_update_net_numbers_of_desktop(phys_screen); ewmh_update_net_desktop_names(phys_screen); ewmh_update_workarea(phys_screen); + + /* resave tag prop of all clients so the number of tag will be the + * same */ + for(client_t *c = globalconf.clients; c; c = c->next) + client_saveprops_tags(c); + /* call hook */ - lua_pushnumber(globalconf.L, s->index+ 1); + lua_pushnumber(globalconf.L, s->index + 1); luaA_dofunction(globalconf.L, globalconf.hooks.tags, 1, 0); } @@ -119,6 +125,12 @@ tag_remove_from_screen(tag_t *tag) ewmh_update_workarea(phys_screen); tag->screen = SCREEN_UNDEF; tag_unref(&tag); + + /* resave tag prop of all clients so the number of tag will be the + * same */ + for(client_t *c = globalconf.clients; c; c = c->next) + client_saveprops_tags(c); + /* call hook */ lua_pushnumber(globalconf.L, screen + 1); luaA_dofunction(globalconf.L, globalconf.hooks.tags, 1, 0);