From 006b43cb6fd140ded636ff36e43753700c8aa8d6 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 14 Feb 2015 15:41:11 +0100 Subject: [PATCH 1/2] awesome: Add startup signal Signed-off-by: Uli Schlachter --- awesome.c | 1 + luaa.c | 8 ++++++++ luaa.h | 1 + 3 files changed, 10 insertions(+) diff --git a/awesome.c b/awesome.c index b847603c0..9835a1f47 100644 --- a/awesome.c +++ b/awesome.c @@ -539,6 +539,7 @@ main(int argc, char **argv) /* scan existing windows */ scan(tree_c); + luaA_emit_startup(); xcb_flush(globalconf.connection); /* Setup the main context */ diff --git a/luaa.c b/luaa.c index 1a2aef78b..bfd1b6b3b 100644 --- a/luaa.c +++ b/luaa.c @@ -474,6 +474,7 @@ luaA_init(xdgHandle* xdg) signal_add(&global_signals, "systray::update"); signal_add(&global_signals, "wallpaper_changed"); signal_add(&global_signals, "refresh"); + signal_add(&global_signals, "startup"); signal_add(&global_signals, "exit"); } @@ -587,6 +588,13 @@ luaA_class_newindex_miss_property(lua_State *L, lua_object_t *obj) return 0; } +void +luaA_emit_startup() +{ + lua_State *L = globalconf_get_lua_State(); + signal_object_emit(L, &global_signals, "startup", 0); +} + void luaA_emit_refresh() { diff --git a/luaa.h b/luaa.h index 9576908bd..b84f1558d 100644 --- a/luaa.h +++ b/luaa.h @@ -206,6 +206,7 @@ int luaA_class_index_miss_property(lua_State *, lua_object_t *); int luaA_class_newindex_miss_property(lua_State *, lua_object_t *); int luaA_default_index(lua_State *); int luaA_default_newindex(lua_State *); +void luaA_emit_startup(void); void luaA_systray_invalidate(void); From fd1b6b15cc8911ad94bd438bc4fcf2d8e4bf8bf9 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 14 Feb 2015 15:42:02 +0100 Subject: [PATCH 2/2] Remove superflous xcb_flush() call (Issue #108) Some lines down we are calling awesome_refresh(). That function already calls xcb_flush() for us. Signed-off-by: Uli Schlachter --- awesome.c | 1 - 1 file changed, 1 deletion(-) diff --git a/awesome.c b/awesome.c index 9835a1f47..c00045180 100644 --- a/awesome.c +++ b/awesome.c @@ -540,7 +540,6 @@ main(int argc, char **argv) scan(tree_c); luaA_emit_startup(); - xcb_flush(globalconf.connection); /* Setup the main context */ g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll);