diff --git a/client.c b/client.c index 7c4c762a..f17e8cd0 100644 --- a/client.c +++ b/client.c @@ -262,6 +262,7 @@ focus(Client *c, Bool selscreen, int screen) XSetInputFocus(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)), RevertToPointerRoot, CurrentTime); + ewmh_update_net_active_window(get_phys_screen(screen)); } @@ -337,8 +338,9 @@ client_manage(Window w, XWindowAttributes *wa, int screen) /* propagates border_width, if size doesn't change */ window_configure(globalconf.display, c->win, c->x, c->y, c->w, c->h, c->border); - /* update sizehint */ + /* update hints */ client_updatesizehints(c); + client_updatewmhints(c); XSelectInput(globalconf.display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); @@ -541,6 +543,7 @@ client_updatewmhints(Client *c) if((wmh = XGetWMHints(globalconf.display, c->win))) { c->isurgent = (wmh->flags & XUrgencyHint); + c->skip = (wmh->initial_state == WithdrawnState); XFree(wmh); } } diff --git a/config.h b/config.h index 9379caa0..b17a5dff 100644 --- a/config.h +++ b/config.h @@ -125,6 +125,8 @@ struct Client Bool isfixed; /** True if the window is maximized */ Bool ismax; + /** True if the client must be skipped from client list */ + Bool skip; /** Next client */ Client *next; /** Previous client */ diff --git a/layout.c b/layout.c index 280c7c9f..6fd60b80 100644 --- a/layout.c +++ b/layout.c @@ -84,9 +84,9 @@ uicb_client_focusnext(int screen, char *arg __attribute__ ((unused))) if(!sel) return; - for(c = sel->next; c && !client_isvisible(c, screen); c = c->next); + for(c = sel->next; c && (c->skip || !client_isvisible(c, screen)); c = c->next); if(!c) - for(c = globalconf.clients; c && !client_isvisible(c, screen); c = c->next); + for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next); if(c) { focus(c, True, screen); @@ -106,11 +106,11 @@ uicb_client_focusprev(int screen, char *arg __attribute__ ((unused))) if(!sel) return; - for(c = sel->prev; c && !client_isvisible(c, screen); c = c->prev); + for(c = sel->prev; c && (c->skip || !client_isvisible(c, screen)); c = c->prev); if(!c) { for(c = globalconf.clients; c && c->next; c = c->next); - for(; c && !client_isvisible(c, screen); c = c->prev); + for(; c && (c->skip || !client_isvisible(c, screen)); c = c->prev); } if(c) {