client manage signal: Remove startup argument

We now have awesome.startup which does the same thing in better.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2014-03-16 20:15:02 +01:00
parent 4d35f430dc
commit fed803a6bc
5 changed files with 35 additions and 49 deletions

View File

@ -149,7 +149,7 @@ scan(xcb_query_tree_cookie_t tree_c)
continue; continue;
} }
client_manage(wins[i], geom_r, attr_r, true); client_manage(wins[i], geom_r, attr_r);
p_delete(&attr_r); p_delete(&attr_r);
p_delete(&geom_r); p_delete(&geom_r);

View File

@ -367,7 +367,7 @@ awful.rules.rules = {
-- {{{ Signals -- {{{ Signals
-- Signal function to execute when a new client appears. -- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c, startup) client.connect_signal("manage", function (c)
-- Enable sloppy focus -- Enable sloppy focus
c:connect_signal("mouse::enter", function(c) c:connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
@ -376,7 +376,7 @@ client.connect_signal("manage", function (c, startup)
end end
end) end)
if not startup then if not awesome.startup then
-- Set the windows at the slave, -- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master. -- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c) -- awful.client.setslave(c)

View File

@ -632,7 +632,7 @@ event_handle_maprequest(xcb_map_request_event_t *ev)
goto bailout; goto bailout;
} }
client_manage(ev->window, geom_r, wa_r, false); client_manage(ev->window, geom_r, wa_r);
p_delete(&geom_r); p_delete(&geom_r);
} }

View File

@ -422,7 +422,7 @@ client_update_properties(client_t *c)
* \param startup True if we are managing at startup time. * \param startup True if we are managing at startup time.
*/ */
void void
client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_attributes_reply_t *wattr, bool startup) client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_attributes_reply_t *wattr)
{ {
const uint32_t select_input_val[] = { CLIENT_SELECT_INPUT_EVENT_MASK }; const uint32_t select_input_val[] = { CLIENT_SELECT_INPUT_EVENT_MASK };
@ -434,10 +434,9 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_at
/* If this is a new client that just has been launched, then request its /* If this is a new client that just has been launched, then request its
* startup id. */ * startup id. */
xcb_get_property_cookie_t startup_id_q = { 0 }; xcb_get_property_cookie_t startup_id_q = xcb_get_property(globalconf.connection, false,
if(!startup) w, _NET_STARTUP_ID,
startup_id_q = xcb_get_property(globalconf.connection, false, w, XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
_NET_STARTUP_ID, XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
/* Make sure the window is automatically mapped if awesome exits or dies. */ /* Make sure the window is automatically mapped if awesome exits or dies. */
xcb_change_save_set(globalconf.connection, XCB_SET_MODE_INSERT, w); xcb_change_save_set(globalconf.connection, XCB_SET_MODE_INSERT, w);
@ -470,9 +469,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_at
globalconf.default_cmap globalconf.default_cmap
}); });
if (startup) /* The client may already be mapped, thus we must be sure that we don't send
{
/* The client is already mapped, thus we must be sure that we don't send
* ourselves an UnmapNotify due to the xcb_reparent_window(). * ourselves an UnmapNotify due to the xcb_reparent_window().
* *
* Grab the server to make sure we don't lose any events. * Grab the server to make sure we don't lose any events.
@ -484,19 +481,13 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, xcb_get_window_at
globalconf.screen->root, globalconf.screen->root,
XCB_CW_EVENT_MASK, XCB_CW_EVENT_MASK,
no_event); no_event);
}
xcb_reparent_window(globalconf.connection, w, c->frame_window, 0, 0); xcb_reparent_window(globalconf.connection, w, c->frame_window, 0, 0);
xcb_map_window(globalconf.connection, w); xcb_map_window(globalconf.connection, w);
if (startup)
{
xcb_change_window_attributes(globalconf.connection, xcb_change_window_attributes(globalconf.connection,
globalconf.screen->root, globalconf.screen->root,
XCB_CW_EVENT_MASK, XCB_CW_EVENT_MASK,
ROOT_WINDOW_EVENT_MASK); ROOT_WINDOW_EVENT_MASK);
xcb_ungrab_server(globalconf.connection); xcb_ungrab_server(globalconf.connection);
}
/* Do this now so that we don't get any events for the above /* Do this now so that we don't get any events for the above
* (Else, reparent could cause an UnmapNotify) */ * (Else, reparent could cause an UnmapNotify) */
@ -571,8 +562,6 @@ HANDLE_GEOM(height)
*/ */
xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL); xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL);
if(!startup)
{
/* Request our response */ /* Request our response */
xcb_get_property_reply_t *reply = xcb_get_property_reply_t *reply =
xcb_get_property_reply(globalconf.connection, startup_id_q, NULL); xcb_get_property_reply(globalconf.connection, startup_id_q, NULL);
@ -581,14 +570,11 @@ HANDLE_GEOM(height)
c->startup_id = startup_id; c->startup_id = startup_id;
p_delete(&reply); p_delete(&reply);
spawn_start_notify(c, startup_id); spawn_start_notify(c, startup_id);
}
luaA_class_emit_signal(globalconf.L, &client_class, "list", 0); luaA_class_emit_signal(globalconf.L, &client_class, "list", 0);
/* client is still on top of the stack; push startup value, /* client is still on top of the stack; emit signal */
* and emit signals with one arg */ luaA_object_emit_signal(globalconf.L, -1, "manage", 0);
lua_pushboolean(globalconf.L, startup);
luaA_object_emit_signal(globalconf.L, -2, "manage", 1);
/* pop client */ /* pop client */
lua_pop(globalconf.L, 1); lua_pop(globalconf.L, 1);
} }

View File

@ -143,7 +143,7 @@ client_t * client_getbyframewin(xcb_window_t);
void client_ban(client_t *); void client_ban(client_t *);
void client_ban_unfocus(client_t *); void client_ban_unfocus(client_t *);
void client_unban(client_t *); void client_unban(client_t *);
void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, xcb_get_window_attributes_reply_t *, bool); void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, xcb_get_window_attributes_reply_t *);
bool client_resize(client_t *, area_t, bool); bool client_resize(client_t *, area_t, bool);
void client_unmanage(client_t *, bool); void client_unmanage(client_t *, bool);
void client_kill(client_t *); void client_kill(client_t *);