dwm-meillo
changeset 105:3e74cc981e9b
refactored Sanders code somewhat
author | arg@10ksloc.org |
---|---|
date | Wed, 19 Jul 2006 13:52:31 +0200 |
parents | 3a708f113f55 |
children | c292574503dd |
files | client.c dwm.h event.c |
diffstat | 3 files changed, 8 insertions(+), 15 deletions(-) [+] |
line diff
1.1 --- a/client.c Wed Jul 19 13:36:04 2006 +0200 1.2 +++ b/client.c Wed Jul 19 13:52:31 2006 +0200 1.3 @@ -315,9 +315,9 @@ 1.4 *c->w = c->maxw; 1.5 if(c->maxh && *c->h > c->maxh) 1.6 *c->h = c->maxh; 1.7 - if(sticky == TopRight || sticky == BottomRight) 1.8 + if(sticky == TopRight || sticky == BotRight) 1.9 *c->x = right - *c->w; 1.10 - if(sticky == BottomLeft || sticky == BottomRight) 1.11 + if(sticky == BotLeft || sticky == BotRight) 1.12 *c->y = bottom - *c->h; 1.13 resizetitle(c); 1.14 XSetWindowBorderWidth(dpy, c->win, 1);
2.1 --- a/dwm.h Wed Jul 19 13:36:04 2006 +0200 2.2 +++ b/dwm.h Wed Jul 19 13:52:31 2006 +0200 2.3 @@ -25,9 +25,9 @@ 2.4 /********** CUSTOMIZE **********/ 2.5 2.6 typedef union Arg Arg; 2.7 +typedef struct Client Client; 2.8 typedef enum Corner Corner; 2.9 typedef struct DC DC; 2.10 -typedef struct Client Client; 2.11 typedef struct Fnt Fnt; 2.12 typedef struct Key Key; 2.13 typedef struct Rule Rule; 2.14 @@ -44,7 +44,7 @@ 2.15 /* cursor */ 2.16 enum { CurNormal, CurResize, CurMove, CurLast }; 2.17 2.18 -enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }; 2.19 +enum Corner { TopLeft, TopRight, BotLeft, BotRight }; 2.20 2.21 struct Fnt { 2.22 int ascent;
3.1 --- a/event.c Wed Jul 19 13:36:04 2006 +0200 3.2 +++ b/event.c Wed Jul 19 13:52:31 2006 +0200 3.3 @@ -114,17 +114,10 @@ 3.4 *c->h = abs(ocy - ev.xmotion.y); 3.5 *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; 3.6 *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; 3.7 - if(ocx <= ev.xmotion.x) { 3.8 - if(ocy <= ev.xmotion.y) 3.9 - sticky = TopLeft; 3.10 - else 3.11 - sticky = BottomLeft; 3.12 - } else { 3.13 - if(ocy <= ev.xmotion.y) 3.14 - sticky = TopRight; 3.15 - else 3.16 - sticky = BottomRight; 3.17 - } 3.18 + if(ocx <= ev.xmotion.x) 3.19 + sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; 3.20 + else 3.21 + sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; 3.22 resize(c, True, sticky); 3.23 break; 3.24 case ButtonRelease: