changeset:   1887:4a5b3afad464
tag:         tip
user:        Kris Maglione <jg_AT_suckless.org>
date:        Thu Feb 15 20:16:13 2007 -0500
summary:     Removed debugging printf from place_client().
diff -r 7b86d01eed8b -r 4a5b3afad464 area.c
--- a/area.c	Thu Feb 15 20:02:13 2007 -0500
+++ b/area.c	Thu Feb 15 20:16:13 2007 -0500
@@ -215,7 +215,7 @@ detach_from_area(Frame *f) {
                 assert(a->sel);
 }
 
-void
+static void
 bit_twiddle(uint *field, uint width, uint x, uint y, Bool set) {
         enum { devisor = sizeof(uint) * 8 };
         uint bx, mask;
@@ -242,6 +242,7 @@ static void
 static void
 place_client(Area *a, Client *c) {
         enum { devisor = sizeof(uint) * 8 };
+	enum { dx = 8, dy = 8 };
         static uint mwidth, mx, my;
         static uint *field = nil;
         BlitzAlign align;
@@ -250,7 +251,7 @@ place_client(Area *a, Client *c) {
         XRectangle *rects;
         Frame *f, *fr;
         Bool fit;
-	uint i, j, x, y, dx, dy, cx, cy, maxx, maxy, diff, num;
+	uint i, j, x, y, cx, cy, maxx, maxy, diff, num;
         int snap;
 
         snap = screen->rect.height / 66;
@@ -267,16 +268,13 @@ place_client(Area *a, Client *c) {
                 || c->size.flags & USPosition
                 || c->size.flags & PPosition)
                 return;
-	rects = rects_of_view(a->view, &num, nil);
         if(!field) {
-		mx = screen->rect.width / 8;
-		my = screen->rect.height / 8;
+		mx = screen->rect.width / dx;
+		my = screen->rect.height / dy;
                 mwidth = ceil((float)mx / devisor);
                 field = emallocz(sizeof(uint) * mwidth * my);
         }
         memset(field, ~0, (sizeof(uint) * mwidth * my));
-	dx = 8;
-	dy = 8;
         for(fr=a->frame; fr; fr=fr->anext) {
                 if(fr == f) {
                         cx = f->rect.width / dx;
@@ -296,11 +294,6 @@ place_client(Area *a, Client *c) {
                 for(j = y; j < my && j < maxy; j++)
                         for(i = x; i < mx && i < maxx; i++)
                                 bit_twiddle(field, mwidth, i, j, False);
-	}
-	for(y = 0; y < my; y++) {
-		for(x = 0; x < mx; x++)
-			fprintf(stderr, "%d", bit_get(field, mwidth, x, y));
-		fprintf(stderr, "\n");
         }
         for(y = 0; y < my; y++)
                 for(x = 0; x < mx; x++) {
@@ -334,6 +327,8 @@ place_client(Area *a, Client *c) {
                 diff = a->rect.height - f->rect.height;
                 f->rect.y = a->rect.y + (random() % (diff ? diff : 1));
         }
+
+	rects = rects_of_view(a->view, &num, nil);
         snap_rect(rects, num, &f->rect, &align, snap);
         if(rects)
                 free(rects);
Received on Fri Feb 16 2007 - 02:16:54 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:22 UTC