dwm-meillo

diff client.c @ 99:a19556fe83b5

applied Sanders resize patch, fixed lower bug
author arg@10ksloc.org
date Wed, 19 Jul 2006 11:31:04 +0200
parents 5d88952cbf96
children bb3803fb560c
line diff
     1.1 --- a/client.c	Tue Jul 18 17:54:55 2006 +0200
     1.2 +++ b/client.c	Wed Jul 19 11:31:04 2006 +0200
     1.3 @@ -267,7 +267,7 @@
     1.4  	*sel->w = sw - 2 * sel->border;
     1.5  	*sel->h = sh - 2 * sel->border - bh;
     1.6  	higher(sel);
     1.7 -	resize(sel, False);
     1.8 +	resize(sel, False, TopLeft);
     1.9  }
    1.10  
    1.11  void
    1.12 @@ -283,9 +283,11 @@
    1.13  }
    1.14  
    1.15  void
    1.16 -resize(Client *c, Bool inc)
    1.17 +resize(Client *c, Bool inc, Corner sticky)
    1.18  {
    1.19  	XConfigureEvent e;
    1.20 +	int right = *c->x + *c->w;
    1.21 +	int bottom = *c->y + *c->h;
    1.22  
    1.23  	if(inc) {
    1.24  		if(c->incw)
    1.25 @@ -305,6 +307,10 @@
    1.26  		*c->w = c->maxw;
    1.27  	if(c->maxh && *c->h > c->maxh)
    1.28  		*c->h = c->maxh;
    1.29 +	if(sticky == TopRight || sticky == BottomRight)
    1.30 +		*c->x = right - *c->w;
    1.31 +	if(sticky == BottomLeft || sticky == BottomRight)
    1.32 +		*c->y = bottom - *c->h;
    1.33  	resizetitle(c);
    1.34  	XSetWindowBorderWidth(dpy, c->win, 1);
    1.35  	XMoveResizeWindow(dpy, c->win, *c->x, *c->y, *c->w, *c->h);