diff options
| author | arg@10ksloc.org <unknown> | 2006-07-19 13:52:31 +0200 |
|---|---|---|
| committer | arg@10ksloc.org <unknown> | 2006-07-19 13:52:31 +0200 |
| commit | 8af1d973323bd799c1ec021bb7c16860e120cf92 (patch) | |
| tree | 47a5d675ab8a444317aaf25a6d2776b0eae7413b | |
| parent | implemented fallback for too many clients in stacked mode (diff) | |
| download | dwm-8af1d973323bd799c1ec021bb7c16860e120cf92.tar.gz dwm-8af1d973323bd799c1ec021bb7c16860e120cf92.zip | |
refactored Sanders code somewhat
Diffstat (limited to '')
| -rw-r--r-- | client.c | 4 | ||||
| -rw-r--r-- | dwm.h | 4 | ||||
| -rw-r--r-- | event.c | 15 |
3 files changed, 8 insertions, 15 deletions
| @@ -315,9 +315,9 @@ resize(Client *c, Bool inc, Corner sticky) | |||
| 315 | *c->w = c->maxw; | 315 | *c->w = c->maxw; |
| 316 | if(c->maxh && *c->h > c->maxh) | 316 | if(c->maxh && *c->h > c->maxh) |
| 317 | *c->h = c->maxh; | 317 | *c->h = c->maxh; |
| 318 | if(sticky == TopRight || sticky == BottomRight) | 318 | if(sticky == TopRight || sticky == BotRight) |
| 319 | *c->x = right - *c->w; | 319 | *c->x = right - *c->w; |
| 320 | if(sticky == BottomLeft || sticky == BottomRight) | 320 | if(sticky == BotLeft || sticky == BotRight) |
| 321 | *c->y = bottom - *c->h; | 321 | *c->y = bottom - *c->h; |
| 322 | resizetitle(c); | 322 | resizetitle(c); |
| 323 | XSetWindowBorderWidth(dpy, c->win, 1); | 323 | XSetWindowBorderWidth(dpy, c->win, 1); |
| @@ -25,9 +25,9 @@ enum { Tscratch, Tdev, Twww, Twork, TLast }; | |||
| 25 | /********** CUSTOMIZE **********/ | 25 | /********** CUSTOMIZE **********/ |
| 26 | 26 | ||
| 27 | typedef union Arg Arg; | 27 | typedef union Arg Arg; |
| 28 | typedef struct Client Client; | ||
| 28 | typedef enum Corner Corner; | 29 | typedef enum Corner Corner; |
| 29 | typedef struct DC DC; | 30 | typedef struct DC DC; |
| 30 | typedef struct Client Client; | ||
| 31 | typedef struct Fnt Fnt; | 31 | typedef struct Fnt Fnt; |
| 32 | typedef struct Key Key; | 32 | typedef struct Key Key; |
| 33 | typedef struct Rule Rule; | 33 | typedef struct Rule Rule; |
| @@ -44,7 +44,7 @@ enum { WMProtocols, WMDelete, WMLast }; | |||
| 44 | /* cursor */ | 44 | /* cursor */ |
| 45 | enum { CurNormal, CurResize, CurMove, CurLast }; | 45 | enum { CurNormal, CurResize, CurMove, CurLast }; |
| 46 | 46 | ||
| 47 | enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }; | 47 | enum Corner { TopLeft, TopRight, BotLeft, BotRight }; |
| 48 | 48 | ||
| 49 | struct Fnt { | 49 | struct Fnt { |
| 50 | int ascent; | 50 | int ascent; |
| @@ -114,17 +114,10 @@ resizemouse(Client *c) | |||
| 114 | *c->h = abs(ocy - ev.xmotion.y); | 114 | *c->h = abs(ocy - ev.xmotion.y); |
| 115 | *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; | 115 | *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; |
| 116 | *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; | 116 | *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; |
| 117 | if(ocx <= ev.xmotion.x) { | 117 | if(ocx <= ev.xmotion.x) |
| 118 | if(ocy <= ev.xmotion.y) | 118 | sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; |
| 119 | sticky = TopLeft; | 119 | else |
| 120 | else | 120 | sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; |
| 121 | sticky = BottomLeft; | ||
| 122 | } else { | ||
| 123 | if(ocy <= ev.xmotion.y) | ||
| 124 | sticky = TopRight; | ||
| 125 | else | ||
| 126 | sticky = BottomRight; | ||
| 127 | } | ||
| 128 | resize(c, True, sticky); | 121 | resize(c, True, sticky); |
| 129 | break; | 122 | break; |
| 130 | case ButtonRelease: | 123 | case ButtonRelease: |
