client.c
changeset 286 ff501d94de62
parent 283 134804791d73
child 291 8e6e0aa5e2ae
equal deleted inserted replaced
285:e864d658eb02 286:ff501d94de62
    47 }
    47 }
    48 
    48 
    49 void
    49 void
    50 focus(Client *c)
    50 focus(Client *c)
    51 {
    51 {
       
    52 	Client *old = sel;
       
    53 
    52 	if (!issel)
    54 	if (!issel)
    53 		return;
    55 		return;
    54 	Client *old = sel;
    56 	if(sel && sel->ismax)
    55 
    57 		togglemax(NULL);
    56 	sel = c;
    58 	sel = c;
    57 	if(old && old != c)
    59 	if(old && old != c)
    58 		drawtitle(old);
    60 		drawtitle(old);
    59 	drawtitle(c);
    61 	drawtitle(c);
    60 	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    62 	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    66 	Client *c;
    68 	Client *c;
    67    
    69    
    68 	if(!sel)
    70 	if(!sel)
    69 		return;
    71 		return;
    70 
    72 
    71 	if(sel->ismax)
       
    72 		togglemax(NULL);
       
    73 
       
    74 	if(!(c = getnext(sel->next)))
    73 	if(!(c = getnext(sel->next)))
    75 		c = getnext(clients);
    74 		c = getnext(clients);
    76 	if(c) {
    75 	if(c) {
    77 		focus(c);
    76 		focus(c);
    78 		restack();
    77 		restack();
    84 {
    83 {
    85 	Client *c;
    84 	Client *c;
    86 
    85 
    87 	if(!sel)
    86 	if(!sel)
    88 		return;
    87 		return;
    89 
       
    90 	if(sel->ismax)
       
    91 		togglemax(NULL);
       
    92 
    88 
    93 	if(!(c = getprev(sel->prev))) {
    89 	if(!(c = getprev(sel->prev))) {
    94 		for(c = clients; c && c->next; c = c->next);
    90 		for(c = clients; c && c->next; c = c->next);
    95 		c = getprev(c);
    91 		c = getprev(c);
    96 	}
    92 	}