Initialise Lua later
This moves Lua initialisation to the latest possible point, just before loading the configuration file. This requires to also move screen initialisation and parts of EWMH initialisation to a later point. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
95b1305613
commit
b4b007796c
17
awesome.c
17
awesome.c
|
@ -564,10 +564,6 @@ main(int argc, char **argv)
|
|||
string_array_append(&searchpath, entry);
|
||||
}
|
||||
|
||||
/* init lua */
|
||||
luaA_init(&xdg, &searchpath);
|
||||
string_array_wipe(&searchpath);
|
||||
|
||||
if (run_test)
|
||||
{
|
||||
bool success = true;
|
||||
|
@ -704,10 +700,6 @@ main(int argc, char **argv)
|
|||
/* init atom cache */
|
||||
atoms_init(globalconf.connection);
|
||||
|
||||
/* init screens information */
|
||||
screen_scan();
|
||||
|
||||
/* do this only for real screen */
|
||||
ewmh_init();
|
||||
systray_init();
|
||||
|
||||
|
@ -758,6 +750,15 @@ main(int argc, char **argv)
|
|||
/* get the current wallpaper, from now on we are informed when it changes */
|
||||
root_update_wallpaper();
|
||||
|
||||
/* init lua */
|
||||
luaA_init(&xdg, &searchpath);
|
||||
string_array_wipe(&searchpath);
|
||||
|
||||
ewmh_init_lua();
|
||||
|
||||
/* init screens information */
|
||||
screen_scan();
|
||||
|
||||
/* Parse and run configuration file */
|
||||
if (!luaA_parserc(&xdg, confpath))
|
||||
fatal("couldn't find any rc file");
|
||||
|
|
6
ewmh.c
6
ewmh.c
|
@ -125,7 +125,6 @@ ewmh_client_update_frame_extents(lua_State *L)
|
|||
void
|
||||
ewmh_init(void)
|
||||
{
|
||||
lua_State *L = globalconf_get_lua_State();
|
||||
xcb_window_t father;
|
||||
xcb_screen_t *xscreen = globalconf.screen;
|
||||
xcb_atom_t atom[] =
|
||||
|
@ -206,7 +205,12 @@ ewmh_init(void)
|
|||
i = getpid();
|
||||
xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
|
||||
father, _NET_WM_PID, XCB_ATOM_CARDINAL, 32, 1, &i);
|
||||
}
|
||||
|
||||
void
|
||||
ewmh_init_lua(void)
|
||||
{
|
||||
lua_State *L = globalconf_get_lua_State();
|
||||
|
||||
luaA_class_connect_signal(L, &client_class, "focus", ewmh_update_net_active_window);
|
||||
luaA_class_connect_signal(L, &client_class, "unfocus", ewmh_update_net_active_window);
|
||||
|
|
Loading…
Reference in New Issue