diff --git a/client.c b/client.c index 53813aa0c..5d6e93e1e 100644 --- a/client.c +++ b/client.c @@ -313,7 +313,6 @@ client_manage(Window w, XWindowAttributes *wa, int screen) Rule *rule; int phys_screen = get_phys_screen(screen); - XLowerWindow(globalconf.display, w); area = get_screen_area(screen, NULL, NULL); c = p_new(Client, 1); @@ -324,6 +323,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen) c->geometry.width = c->f_geometry.width = c->m_geometry.width = wa->width; c->geometry.height = c->f_geometry.height = c->m_geometry.height = wa->height; c->oldborder = wa->border_width; + c->newcomer = True; c->screen = get_screen_bycoord(c->geometry.x, c->geometry.y); diff --git a/config.h b/config.h index 5cb5b4abc..759612489 100644 --- a/config.h +++ b/config.h @@ -187,6 +187,8 @@ struct Client Window win; /** Client logical screen */ int screen; + /** True if the client is a new one */ + Bool newcomer; }; typedef struct FocusList FocusList; diff --git a/layout.c b/layout.c index 970162ebe..848919d96 100644 --- a/layout.c +++ b/layout.c @@ -63,14 +63,20 @@ arrange(int screen) for(c = globalconf.clients; c; c = c->next) { - if(client_isvisible(c, screen)) + if(client_isvisible(c, screen) && !c->newcomer) client_unban(c); /* we don't touch other screens windows */ - else if(c->screen == screen) + else if(c->screen == screen || c->newcomer) client_ban(c); } curtags[0]->layout->arrange(screen); + for(c = globalconf.clients; c; c = c->next) + if(c->newcomer && client_isvisible(c, screen)) + { + c->newcomer = False; + client_unban(c); + } c = focus_get_current_client(screen); focus(c, True, screen); if(c && XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)),