tag: emit screen signals when attaching and detaching tags

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-07-13 14:35:04 +02:00
parent 7b04d8ef6f
commit 38ada2bdc7
1 changed files with 5 additions and 1 deletions

6
tag.c
View File

@ -119,6 +119,9 @@ tag_append_to_screen(lua_State *L, int udx, screen_t *s)
lua_pushliteral(globalconf.L, "add");
luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.tags, 3, 0);
}
luaA_object_push(globalconf.L, tag);
screen_emit_signal(globalconf.L, s, "tag::attach", 1);
}
/** Remove a tag from screen. Tag must be on a screen and have no clients.
@ -150,11 +153,12 @@ tag_remove_from_screen(tag_t *tag)
luaA_dofunction_from_registry(globalconf.L, globalconf.hooks.tags, 3, 0);
}
screen_t *s = tag->screen;
tag->screen = NULL;
luaA_object_push(globalconf.L, tag);
luaA_object_emit_signal(globalconf.L, -1, "property::screen", 0);
lua_pop(globalconf.L, 1);
screen_emit_signal(globalconf.L, s, "tag::detach", 1);
luaA_object_unref(globalconf.L, tag);
}