dwm-meillo

diff client.c @ 32:082c75b937b5

removed unnecessary crap
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:30:55 +0200
parents 386649deb651
children e90449e03167
line diff
     1.1 --- a/client.c	Thu Jul 13 01:04:38 2006 +0200
     1.2 +++ b/client.c	Thu Jul 13 01:30:55 2006 +0200
     1.3 @@ -7,8 +7,8 @@
     1.4  #include <stdlib.h>
     1.5  #include <string.h>
     1.6  #include <X11/Xatom.h>
     1.7 +#include <X11/Xutil.h>
     1.8  
     1.9 -#include "util.h"
    1.10  #include "wm.h"
    1.11  
    1.12  void (*arrange)(void *aux);
    1.13 @@ -19,9 +19,9 @@
    1.14  	if(!stack)
    1.15  		return;
    1.16  	stack->x = sx;
    1.17 -	stack->y = bh;
    1.18 +	stack->y = sy;
    1.19  	stack->w = sw - 2 * stack->border;
    1.20 -	stack->h = sh - bh - 2 * stack->border;
    1.21 +	stack->h = sh - 2 * stack->border;
    1.22  	resize(stack);
    1.23  	discard_events(EnterWindowMask);
    1.24  }
    1.25 @@ -59,11 +59,11 @@
    1.26  		cols = rows;
    1.27  
    1.28  	gw = (sw - 2)  / cols;
    1.29 -	gh = (sh - bh - 2) / rows;
    1.30 +	gh = (sh - 2) / rows;
    1.31  
    1.32  	for(i = j = 0, c = clients; c; c = c->next) {
    1.33  		c->x = i * gw;
    1.34 -		c->y = j * gh + bh;
    1.35 +		c->y = j * gh;
    1.36  		c->w = gw;
    1.37  		c->h = gh;
    1.38  		resize(c);
    1.39 @@ -89,12 +89,12 @@
    1.40  		for(c = stack; c && c->snext; c = c->snext);
    1.41  	if(!c)
    1.42  		c = stack;
    1.43 -	raise(c);
    1.44 +	craise(c);
    1.45  	focus(c);
    1.46  }
    1.47  
    1.48  void
    1.49 -kill(void *aux)
    1.50 +ckill(void *aux)
    1.51  {
    1.52  	Client *c = stack;
    1.53  
    1.54 @@ -114,8 +114,8 @@
    1.55  	c->tw = 0;
    1.56  	for(i = 0; i < TLast; i++)
    1.57  		if(c->tags[i])
    1.58 -			c->tw += textw(&brush.font, c->tags[i]) + bh;
    1.59 -	c->tw += textw(&brush.font, c->name) + bh;
    1.60 +			c->tw += textw(&brush.font, c->tags[i]) + brush.font.height;
    1.61 +	c->tw += textw(&brush.font, c->name) + brush.font.height;
    1.62  	if(c->tw > c->w)
    1.63  		c->tw = c->w + 2;
    1.64  	c->tx = c->x + c->w - c->tw + 2;
    1.65 @@ -190,7 +190,7 @@
    1.66  }
    1.67  
    1.68  void
    1.69 -raise(Client *c)
    1.70 +craise(Client *c)
    1.71  {
    1.72  	XRaiseWindow(dpy, c->win);
    1.73  	XRaiseWindow(dpy, c->title);
    1.74 @@ -234,11 +234,9 @@
    1.75  	c->win = w;
    1.76  	c->tx = c->x = wa->x;
    1.77  	c->ty = c->y = wa->y;
    1.78 -	if(c->y < bh)
    1.79 -		c->ty = c->y += bh;
    1.80  	c->tw = c->w = wa->width;
    1.81  	c->h = wa->height;
    1.82 -	c->th = bh;
    1.83 +	c->th = th;
    1.84  	c->border = 1;
    1.85  	update_size(c);
    1.86  	XSetWindowBorderWidth(dpy, c->win, 1);
    1.87 @@ -379,10 +377,8 @@
    1.88  	XDestroyWindow(dpy, c->title);
    1.89  
    1.90  	for(l=&clients; *l && *l != c; l=&(*l)->next);
    1.91 -	eassert(*l == c);
    1.92  	*l = c->next;
    1.93  	for(l=&stack; *l && *l != c; l=&(*l)->snext);
    1.94 -	eassert(*l == c);
    1.95  	*l = c->snext;
    1.96  	free(c);
    1.97  
    1.98 @@ -418,10 +414,8 @@
    1.99  draw_client(Client *c)
   1.100  {
   1.101  	int i;
   1.102 -	if(c == stack) {
   1.103 -		draw_bar();
   1.104 +	if(c == stack)
   1.105  		return;
   1.106 -	}
   1.107  
   1.108  	brush.x = brush.y = 0;
   1.109  	brush.h = c->th;
   1.110 @@ -430,12 +424,12 @@
   1.111  	for(i = 0; i < TLast; i++) {
   1.112  		if(c->tags[i]) {
   1.113  			brush.x += brush.w;
   1.114 -			brush.w = textw(&brush.font, c->tags[i]) + bh;
   1.115 +			brush.w = textw(&brush.font, c->tags[i]) + brush.font.height;
   1.116  			draw(dpy, &brush, True, c->tags[i]);
   1.117  		}
   1.118  	}
   1.119  	brush.x += brush.w;
   1.120 -	brush.w = textw(&brush.font, c->name) + bh;
   1.121 +	brush.w = textw(&brush.font, c->name) + brush.font.height;
   1.122  	draw(dpy, &brush, True, c->name);
   1.123  	XCopyArea(dpy, brush.drawable, c->title, brush.gc,
   1.124  			0, 0, c->tw, c->th, 0, 0);