dwm-meillo

diff client.c @ 687:a76799907854

removed client title bar
author Anselm R. Garbe <arg@suckless.org>
date Sun, 14 Jan 2007 22:27:29 +0100
parents fd2ea58b0b94
children 399f08187c27
line diff
     1.1 --- a/client.c	Fri Jan 12 21:56:01 2007 +0100
     1.2 +++ b/client.c	Sun Jan 14 22:27:29 2007 +0100
     1.3 @@ -61,12 +61,6 @@
     1.4  /* extern functions */
     1.5  
     1.6  void
     1.7 -ban(Client *c) {
     1.8 -	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
     1.9 -	XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
    1.10 -}
    1.11 -
    1.12 -void
    1.13  configure(Client *c) {
    1.14  	XEvent synev;
    1.15  
    1.16 @@ -121,16 +115,6 @@
    1.17  	return NULL;
    1.18  }
    1.19  
    1.20 -Client *
    1.21 -getctitle(Window w) {
    1.22 -	Client *c;
    1.23 -
    1.24 -	for(c = clients; c; c = c->next)
    1.25 -		if(c->twin == w)
    1.26 -			return c;
    1.27 -	return NULL;
    1.28 -}
    1.29 -
    1.30  void
    1.31  killclient(Arg *arg) {
    1.32  	if(!sel)
    1.33 @@ -145,17 +129,15 @@
    1.34  manage(Window w, XWindowAttributes *wa) {
    1.35  	Client *c;
    1.36  	Window trans;
    1.37 -	XSetWindowAttributes twa;
    1.38  
    1.39  	c = emallocz(sizeof(Client));
    1.40  	c->tags = emallocz(ntags * sizeof(Bool));
    1.41  	c->win = w;
    1.42  	c->border = 0;
    1.43 -	c->x = c->tx = wa->x;
    1.44 -	c->y = c->ty = wa->y;
    1.45 -	c->w = c->tw = wa->width;
    1.46 +	c->x = wa->x;
    1.47 +	c->y = wa->y;
    1.48 +	c->w = wa->width;
    1.49  	c->h = wa->height;
    1.50 -	c->th = bh;
    1.51  	updatesizehints(c);
    1.52  	if(c->x + c->w + 2 * BORDERPX > sw)
    1.53  		c->x = sw - c->w - 2 * BORDERPX;
    1.54 @@ -169,27 +151,18 @@
    1.55  	XSelectInput(dpy, c->win,
    1.56  		StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
    1.57  	XGetTransientForHint(dpy, c->win, &trans);
    1.58 -	twa.override_redirect = 1;
    1.59 -	twa.background_pixmap = ParentRelative;
    1.60 -	twa.event_mask = ExposureMask | EnterWindowMask;
    1.61 -	c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
    1.62 -			0, DefaultDepth(dpy, screen), CopyFromParent,
    1.63 -			DefaultVisual(dpy, screen),
    1.64 -			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
    1.65  	grabbuttons(c, False);
    1.66  	updatetitle(c);
    1.67  	settags(c, getclient(trans));
    1.68  	if(!c->isfloat)
    1.69  		c->isfloat = trans || c->isfixed;
    1.70 -	resizetitle(c);
    1.71  	if(clients)
    1.72  		clients->prev = c;
    1.73  	c->next = clients;
    1.74  	c->snext = stack;
    1.75  	stack = clients = c;
    1.76 -	ban(c);
    1.77 +	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
    1.78  	XMapWindow(dpy, c->win);
    1.79 -	XMapWindow(dpy, c->twin);
    1.80  	if(isvisible(c))
    1.81  		focus(c);
    1.82  	arrange();
    1.83 @@ -228,7 +201,6 @@
    1.84  		c->x = sw - c->w;
    1.85  	if(c->y > sh)
    1.86  		c->y = sh - c->h;
    1.87 -	resizetitle(c);
    1.88  	wc.x = c->x;
    1.89  	wc.y = c->y;
    1.90  	wc.width = c->w;
    1.91 @@ -243,19 +215,6 @@
    1.92  }
    1.93  
    1.94  void
    1.95 -resizetitle(Client *c) {
    1.96 -	c->tw = textw(c->name);
    1.97 -	if(c->tw > c->w)
    1.98 -		c->tw = c->w + 2 * BORDERPX;
    1.99 -	c->tx = c->x + c->w - c->tw + 2 * BORDERPX;
   1.100 -	c->ty = c->y;
   1.101 -	if(isvisible(c))
   1.102 -		XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
   1.103 -	else
   1.104 -		XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
   1.105 -}
   1.106 -
   1.107 -void
   1.108  updatesizehints(Client *c) {
   1.109  	long msize;
   1.110  	XSizeHints size;
   1.111 @@ -331,7 +290,6 @@
   1.112  		focus(nc);
   1.113  	}
   1.114  	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
   1.115 -	XDestroyWindow(dpy, c->twin);
   1.116  	free(c->tags);
   1.117  	free(c);
   1.118  	XSync(dpy, False);