client.c
changeset 327 96d09fd98e89
parent 320 30b447bad2e5
child 342 a1901753deef
equal deleted inserted replaced
326:73efaa15a635 327:96d09fd98e89
    85 		drawtitle(old);
    85 		drawtitle(old);
    86 	}
    86 	}
    87 	ungrabbutton(c, AnyButton, 0);
    87 	ungrabbutton(c, AnyButton, 0);
    88 	drawtitle(c);
    88 	drawtitle(c);
    89 	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    89 	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    90 }
       
    91 
       
    92 void
       
    93 focusnext(Arg *arg)
       
    94 {
       
    95 	Client *c;
       
    96    
       
    97 	if(!sel)
       
    98 		return;
       
    99 
       
   100 	if(!(c = getnext(sel->next)))
       
   101 		c = getnext(clients);
       
   102 	if(c) {
       
   103 		focus(c);
       
   104 		restack();
       
   105 	}
       
   106 }
       
   107 
       
   108 void
       
   109 focusprev(Arg *arg)
       
   110 {
       
   111 	Client *c;
       
   112 
       
   113 	if(!sel)
       
   114 		return;
       
   115 
       
   116 	if(!(c = getprev(sel->prev))) {
       
   117 		for(c = clients; c && c->next; c = c->next);
       
   118 		c = getprev(c);
       
   119 	}
       
   120 	if(c) {
       
   121 		focus(c);
       
   122 		restack();
       
   123 	}
       
   124 }
    90 }
   125 
    91 
   126 Client *
    92 Client *
   127 getclient(Window w)
    93 getclient(Window w)
   128 {
    94 {
   444 	XUngrabServer(dpy);
   410 	XUngrabServer(dpy);
   445 	if(sel)
   411 	if(sel)
   446 		focus(sel);
   412 		focus(sel);
   447 	arrange(NULL);
   413 	arrange(NULL);
   448 }
   414 }
   449 
       
   450 void
       
   451 zoom(Arg *arg)
       
   452 {
       
   453 	Client *c;
       
   454 
       
   455 	if(!sel || (arrange != dotile) || sel->isfloat || sel->ismax)
       
   456 		return;
       
   457 
       
   458 	if(sel == getnext(clients))  {
       
   459 		if((c = getnext(sel->next)))
       
   460 			sel = c;
       
   461 		else
       
   462 			return;
       
   463 	}
       
   464 
       
   465 	/* pop */
       
   466 	sel->prev->next = sel->next;
       
   467 	if(sel->next)
       
   468 		sel->next->prev = sel->prev;
       
   469 	sel->prev = NULL;
       
   470 	clients->prev = sel;
       
   471 	sel->next = clients;
       
   472 	clients = sel;
       
   473 	focus(sel);
       
   474 	arrange(NULL);
       
   475 }