[hackers] wmii: new tip (= 1781)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Thu, 08 Feb 2007 07:20:04 +0100

changeset: 1781:21f3789a6856
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Feb 08 01:17:25 2007 -0500
files: view.c
description:
Clean up a nasty for-loop

diff -r 3a9a31a40860 -r 21f3789a6856 view.c
--- a/view.c Thu Feb 08 00:05:27 2007 -0500
+++ b/view.c Thu Feb 08 01:17:25 2007 -0500
@@ -87,9 +87,11 @@ destroy_view(View *v) {
         for(i=&view; *i; i=&(*i)->next)
                 if(*i == v) break;
         *i = v->next;
- if(screen->sel == v)
- for(screen->sel=view; screen->sel && screen->sel->next; screen->sel=screen->sel->next)
- if(screen->sel->next == *i) break;
+ if(screen->sel == v) {
+ for(v = view; v && v->next; v = v->next)
+ if(v->next == *i) break;
+ screen->sel = *i;
+ }
         write_event("DestroyTag %s\n", v->name);
         free(v);
 }
@@ -115,10 +117,9 @@ focus_view(WMScreen *s, View *v) {
         /* gives all(!) clients proper geometry (for use of different tags) */
         for(c=client; c; c=c->next)
                 if((f = c->sel)) {
- if(f->view == v) {
+ if(f->view == v)
                                 resize_client(c, &f->rect);
- //XMoveWindow(blz.dpy, c->framewin, f->rect.x, f->rect.y);
- }else
+ else
                                 XMoveWindow(blz.dpy, c->framewin, 2 * s->rect.width + f->rect.x,
                                                 f->rect.y);
                 }
Received on Thu Feb 08 2007 - 07:20:04 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:58 UTC