hooks: manage gets an extra startup arg

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-12-29 12:23:37 +01:00
parent 8aa8b17c75
commit cd667802db
6 changed files with 10 additions and 7 deletions

View File

@ -178,7 +178,7 @@ scan(void)
screen = screen_getbycoord(phys_screen, geom_r->x, geom_r->y); screen = screen_getbycoord(phys_screen, geom_r->x, geom_r->y);
client_manage(wins[i], geom_r, phys_screen, screen); client_manage(wins[i], geom_r, phys_screen, screen, true);
p_delete(&geom_r); p_delete(&geom_r);
} }

View File

@ -327,7 +327,7 @@ awful.hooks.mouse_enter.register(function (c)
end) end)
-- Hook function to execute when a new client appears. -- Hook function to execute when a new client appears.
awful.hooks.manage.register(function (c) awful.hooks.manage.register(function (c, startup)
if use_titlebar then if use_titlebar then
-- Add a titlebar -- Add a titlebar
awful.titlebar.add(c, { modkey = modkey }) awful.titlebar.add(c, { modkey = modkey })

View File

@ -440,9 +440,10 @@ client_duplicate_tags(client_t *src_c, client_t *dst_c)
* \param wgeom Window geometry. * \param wgeom Window geometry.
* \param phys_screen Physical screen number. * \param phys_screen Physical screen number.
* \param screen Virtual screen number where to manage client. * \param screen Virtual screen number where to manage client.
* \param startup True if we are managing at startup time.
*/ */
void void
client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, int screen) client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, int screen, bool startup)
{ {
xcb_get_property_cookie_t ewmh_icon_cookie; xcb_get_property_cookie_t ewmh_icon_cookie;
client_t *c, *tc = NULL, *group = NULL; client_t *c, *tc = NULL, *group = NULL;
@ -591,7 +592,8 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen,
if(globalconf.hooks.manage != LUA_REFNIL) if(globalconf.hooks.manage != LUA_REFNIL)
{ {
luaA_client_userdata_new(globalconf.L, c); luaA_client_userdata_new(globalconf.L, c);
luaA_dofunction(globalconf.L, globalconf.hooks.manage, 1, 0); lua_pushboolean(globalconf.L, startup);
luaA_dofunction(globalconf.L, globalconf.hooks.manage, 2, 0);
} }
} }

View File

@ -50,7 +50,7 @@ client_t * client_getbywin(xcb_window_t);
void client_stack(void); void client_stack(void);
void client_ban(client_t *); void client_ban(client_t *);
void client_unban(client_t *); void client_unban(client_t *);
void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, int, int); void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, int, int, bool);
area_t client_geometry_hints(client_t *, area_t); area_t client_geometry_hints(client_t *, area_t);
void client_resize(client_t *, area_t, bool); void client_resize(client_t *, area_t, bool);
void client_unmanage(client_t *); void client_unmanage(client_t *);

View File

@ -645,7 +645,7 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
else else
screen = phys_screen; screen = phys_screen;
client_manage(ev->window, geom_r, phys_screen, screen); client_manage(ev->window, geom_r, phys_screen, screen, false);
p_delete(&geom_r); p_delete(&geom_r);
} }

View File

@ -58,7 +58,8 @@ luaA_hooks_unfocus(lua_State *L)
} }
/** Set the function called each time a new client appears. This function is /** Set the function called each time a new client appears. This function is
* called with the client object as argument. * called with the client object as argument, plus a boolean argument which is
* true if the client is managed at startup.
* \param L The Lua VM state. * \param L The Lua VM state.
* \return The number of elements pushed on stack. * \return The number of elements pushed on stack.
* \luastack * \luastack