hooks: manage gets an extra startup arg
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
8aa8b17c75
commit
cd667802db
|
@ -178,7 +178,7 @@ scan(void)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ awful.hooks.mouse_enter.register(function (c)
|
|||
end)
|
||||
|
||||
-- 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
|
||||
-- Add a titlebar
|
||||
awful.titlebar.add(c, { modkey = modkey })
|
||||
|
|
6
client.c
6
client.c
|
@ -440,9 +440,10 @@ client_duplicate_tags(client_t *src_c, client_t *dst_c)
|
|||
* \param wgeom Window geometry.
|
||||
* \param phys_screen Physical screen number.
|
||||
* \param screen Virtual screen number where to manage client.
|
||||
* \param startup True if we are managing at startup time.
|
||||
*/
|
||||
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;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
client.h
2
client.h
|
@ -50,7 +50,7 @@ client_t * client_getbywin(xcb_window_t);
|
|||
void client_stack(void);
|
||||
void client_ban(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);
|
||||
void client_resize(client_t *, area_t, bool);
|
||||
void client_unmanage(client_t *);
|
||||
|
|
2
event.c
2
event.c
|
@ -645,7 +645,7 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
|
|||
else
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
3
hooks.c
3
hooks.c
|
@ -58,7 +58,8 @@ luaA_hooks_unfocus(lua_State *L)
|
|||
}
|
||||
|
||||
/** 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.
|
||||
* \return The number of elements pushed on stack.
|
||||
* \luastack
|
||||
|
|
Loading…
Reference in New Issue