[hackers] [wmii] Fix some Xinerama bugs || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 14 Oct 2008 22:09:50 +0000 (UTC)

changeset: 2366:51de8e1fe0f1
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Oct 14 18:09:47 2008 -0400
files: cmd/wmii/_util.c cmd/wmii/area.c cmd/wmii/client.c cmd/wmii/column.c cmd/wmii/fns.h cmd/wmii/view.c
description:
Fix some Xinerama bugs

diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/_util.c
--- a/cmd/wmii/_util.c Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/_util.c Tue Oct 14 18:09:47 2008 -0400
@@ -124,7 +124,9 @@
                 argv[i] = va_arg(ap, char*);
         va_end(ap);
 
- return spawn3(fd, file, argv);
+ i = spawn3(fd, file, argv);
+ free(argv);
+ return i;
 }
 
 #ifdef __linux__
@@ -174,6 +176,7 @@
         unlink(gdbcmd);
 
 done:
+ free(gdbcmd);
         kill(pid, SIGKILL);
         waitpid(pid, &status, 0);
 }
diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/area.c
--- a/cmd/wmii/area.c Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/area.c Tue Oct 14 18:09:47 2008 -0400
@@ -13,13 +13,15 @@
         return nil;
 }
 
-uint
+int
 area_idx(Area *a) {
         View *v;
         Area *ap;
         uint i;
 
         v = a->view;
+ if(a->floating)
+ return -1;
         i = 1;
         for(ap=v->areas[a->screen]; a != ap; ap=ap->next)
                 i++;
@@ -120,6 +122,8 @@
         if(v->sel == nil && !a->floating)
                 area_focus(a);
 
+ print("%s: screen: %d a: %p mode: %x floating: %d v->floating: %p v->areas: %p\n", v->name, a->screen, a, a->mode, a->floating, v->floating, v->areas);
+
         if(!a->floating)
                 event("CreateColumn %ud\n", i);
         return a;
@@ -151,11 +155,13 @@
         /* Can only destroy the floating area when destroying a
          * view---after destroying all columns.
          */
- assert(!a->floating || a->prev || a->next);
+ assert(!a->floating || !v->areas[0]);
         if(a->prev)
                 a->prev->next = a->next;
+ else if(!a->floating)
+ v->areas[a->screen] = a->next;
         else
- v->areas[a->screen] = a->next;
+ v->floating = nil;
         if(a->next)
                 a->next->prev = a->prev;
 
diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/client.c
--- a/cmd/wmii/client.c Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/client.c Tue Oct 14 18:09:47 2008 -0400
@@ -68,6 +68,7 @@
                         if(*gp == g) break;
                 assert(*gp == g);
                 gp[0] = gp[0]->next;
+ free(g);
         }
 }
 
diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/column.c
--- a/cmd/wmii/column.c Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/column.c Tue Oct 14 18:09:47 2008 -0400
@@ -554,6 +554,7 @@
                         f->collapsed = (f != a->sel);
                 break;
         default:
+ print("Dieing: %s: screen: %d a: %p mode: %x floating: %d\n", v->name, a->screen, a, a->mode, a->floating);
                 die("not reached");
                 break;
         }
diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/fns.h Tue Oct 14 18:09:47 2008 -0400
@@ -38,7 +38,7 @@
 void area_destroy(Area*);
 void area_detach(Frame*);
 void area_focus(Area*);
-uint area_idx(Area*);
+int area_idx(Area*);
 void area_moveto(Area*, Frame*);
 char* area_name(Area*);
 Client* area_selclient(Area*);
diff -r 812e1c20dddf -r 51de8e1fe0f1 cmd/wmii/view.c
--- a/cmd/wmii/view.c Tue Oct 14 16:57:48 2008 -0400
+++ b/cmd/wmii/view.c Tue Oct 14 18:09:47 2008 -0400
@@ -241,6 +241,7 @@
         frames_update_sel(v);
         view_arrange(v);
 
+ fscrn = false;
         foreach_frame(v, s, a, f)
                 if(f->client->fullscreen) {
                         f->collapsed = false;
@@ -485,7 +486,7 @@
                 /* This is wrong... */
                 a->r.min.y = v->r.min.y;
                 a->r.max.y = v->r.max.y;
- print("a->r: %R %R %R\n", a->r, v->r, screen->r);
+/* print("a->r: %R %R %R\n", a->r, v->r, screen->r); */
                 column_arrange(a, false);
         }
         if(v == screen->sel)
Received on Tue Oct 14 2008 - 22:09:50 UTC

This archive was generated by hypermail 2.2.0 : Tue Oct 14 2008 - 22:12:05 UTC