view.c
changeset 443 548084f8d92e
parent 442 056a5072c70a
child 446 a2e587651c79
equal deleted inserted replaced
442:056a5072c70a 443:548084f8d92e
    10 static Client *
    10 static Client *
    11 minclient()
    11 minclient()
    12 {
    12 {
    13 	Client *c, *min;
    13 	Client *c, *min;
    14 
    14 
       
    15 	if((clients && clients->isfloat) || arrange == dofloat)
       
    16 		return clients; /* don't touch floating order */
    15 	for(min = c = clients; c; c = c->next)
    17 	for(min = c = clients; c; c = c->next)
    16 		if(c->weight < min->weight)
    18 		if(c->weight < min->weight)
    17 			min = c;
    19 			min = c;
    18 	return min;
    20 	return min;
    19 }
       
    20 
       
    21 static void
       
    22 pop(Client *c)
       
    23 {
       
    24 	detach(c);
       
    25 	if(clients)
       
    26 		clients->prev = c;
       
    27 	c->next = clients;
       
    28 	clients = c;
       
    29 }
    21 }
    30 
    22 
    31 static void
    23 static void
    32 reorder()
    24 reorder()
    33 {
    25 {
   230 	if(!sel) {
   222 	if(!sel) {
   231 		drawstatus();
   223 		drawstatus();
   232 		return;
   224 		return;
   233 	}
   225 	}
   234 	if(sel->isfloat || arrange == dofloat) {
   226 	if(sel->isfloat || arrange == dofloat) {
   235 		pop(sel);
       
   236 		XRaiseWindow(dpy, sel->win);
   227 		XRaiseWindow(dpy, sel->win);
   237 		XRaiseWindow(dpy, sel->twin);
   228 		XRaiseWindow(dpy, sel->twin);
   238 	}
   229 	}
   239 	if(arrange != dofloat) 
   230 	if(arrange != dofloat) 
   240 		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
   231 		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
   305 		return;
   296 		return;
   306 
   297 
   307 	if((c = sel) == nexttiled(clients))
   298 	if((c = sel) == nexttiled(clients))
   308 		if(!(c = nexttiled(c->next)))
   299 		if(!(c = nexttiled(c->next)))
   309 			return;
   300 			return;
   310 	pop(c);
   301 	detach(c);
       
   302 	if(clients)
       
   303 		clients->prev = c;
       
   304 	c->next = clients;
       
   305 	clients = c;
   311 	focus(c);
   306 	focus(c);
   312 	arrange(NULL);
   307 	arrange(NULL);
   313 }
   308 }