windows that start in Withdrawstate are skipped in focus list

This commit is contained in:
Julien Danjou 2007-12-28 13:43:47 +01:00
parent 629f2efb83
commit e0c1472249
3 changed files with 10 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -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 */

View File

@ -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)
{