client: client screen change at manage is done in Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
cd667802db
commit
d779aa6c40
|
@ -95,7 +95,7 @@ awesome_atexit(void)
|
|||
static void
|
||||
scan(void)
|
||||
{
|
||||
int i, screen, phys_screen, tree_c_len;
|
||||
int i, phys_screen, tree_c_len;
|
||||
const int screen_max = xcb_setup_roots_length(xcb_get_setup(globalconf.connection));
|
||||
root_win_t root_wins[screen_max];
|
||||
xcb_query_tree_reply_t *tree_r;
|
||||
|
@ -176,9 +176,7 @@ scan(void)
|
|||
*(geom_wins[i]), NULL)))
|
||||
continue;
|
||||
|
||||
screen = screen_getbycoord(phys_screen, geom_r->x, geom_r->y);
|
||||
|
||||
client_manage(wins[i], geom_r, phys_screen, screen, true);
|
||||
client_manage(wins[i], geom_r, phys_screen, true);
|
||||
|
||||
p_delete(&geom_r);
|
||||
}
|
||||
|
|
|
@ -364,6 +364,12 @@ awful.hooks.manage.register(function (c, startup)
|
|||
awful.client.movetotag(tags[target.screen][target.tag], c)
|
||||
end
|
||||
|
||||
-- If we are not managing this applicatin at startup,
|
||||
-- move it to the screen where the mouse is
|
||||
if not startup then
|
||||
c.screen = mouse.screen
|
||||
end
|
||||
|
||||
-- Do this after tag mapping, so you don't see it on the wrong tag for a split second.
|
||||
client.focus = c
|
||||
|
||||
|
|
6
client.c
6
client.c
|
@ -439,15 +439,15 @@ client_duplicate_tags(client_t *src_c, client_t *dst_c)
|
|||
* \param w The window.
|
||||
* \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, bool startup)
|
||||
client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, bool startup)
|
||||
{
|
||||
xcb_get_property_cookie_t ewmh_icon_cookie;
|
||||
client_t *c, *tc = NULL, *group = NULL;
|
||||
image_t *icon;
|
||||
int screen;
|
||||
const uint32_t select_input_val[] =
|
||||
{
|
||||
XCB_EVENT_MASK_STRUCTURE_NOTIFY
|
||||
|
@ -468,7 +468,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen,
|
|||
xcb_change_window_attributes(globalconf.connection, w, XCB_CW_EVENT_MASK, select_input_val);
|
||||
c = p_new(client_t, 1);
|
||||
|
||||
c->screen = screen_getbycoord(screen, wgeom->x, wgeom->y);
|
||||
screen = c->screen = screen_getbycoord(phys_screen, wgeom->x, wgeom->y);
|
||||
|
||||
c->phys_screen = phys_screen;
|
||||
|
||||
|
|
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, bool);
|
||||
void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, int, bool);
|
||||
area_t client_geometry_hints(client_t *, area_t);
|
||||
void client_resize(client_t *, area_t, bool);
|
||||
void client_unmanage(client_t *);
|
||||
|
|
20
event.c
20
event.c
|
@ -587,12 +587,10 @@ static int
|
|||
event_handle_maprequest(void *data __attribute__ ((unused)),
|
||||
xcb_connection_t *connection, xcb_map_request_event_t *ev)
|
||||
{
|
||||
int phys_screen, screen = 0, ret = 0;
|
||||
int phys_screen, ret = 0;
|
||||
client_t *c;
|
||||
xcb_get_window_attributes_cookie_t wa_c;
|
||||
xcb_get_window_attributes_reply_t *wa_r;
|
||||
xcb_query_pointer_cookie_t qp_c = { 0 };
|
||||
xcb_query_pointer_reply_t *qp_r = NULL;
|
||||
xcb_get_geometry_cookie_t geom_c;
|
||||
xcb_get_geometry_reply_t *geom_r;
|
||||
|
||||
|
@ -623,34 +621,20 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
|
|||
{
|
||||
geom_c = xcb_get_geometry_unchecked(connection, ev->window);
|
||||
|
||||
if(globalconf.xinerama_is_active)
|
||||
qp_c = xcb_query_pointer_unchecked(connection,
|
||||
xutil_screen_get(globalconf.connection,
|
||||
globalconf.default_screen)->root);
|
||||
|
||||
if(!(geom_r = xcb_get_geometry_reply(connection, geom_c, NULL)))
|
||||
{
|
||||
if(globalconf.xinerama_is_active)
|
||||
qp_r = xcb_query_pointer_reply(connection, qp_c, NULL);
|
||||
ret = -1;
|
||||
goto bailout;
|
||||
}
|
||||
|
||||
|
||||
phys_screen = xutil_root2screen(connection, geom_r->root);
|
||||
|
||||
if(globalconf.xinerama_is_active
|
||||
&& (qp_r = xcb_query_pointer_reply(connection, qp_c, NULL)))
|
||||
screen = screen_getbycoord(screen, qp_r->root_x, qp_r->root_y);
|
||||
else
|
||||
screen = phys_screen;
|
||||
client_manage(ev->window, geom_r, phys_screen, false);
|
||||
|
||||
client_manage(ev->window, geom_r, phys_screen, screen, false);
|
||||
p_delete(&geom_r);
|
||||
}
|
||||
|
||||
bailout:
|
||||
p_delete(&qp_r);
|
||||
p_delete(&wa_r);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue