# HG changeset patch # User arg@10ksloc.org # Date 1153309951 -7200 # Node ID 3e74cc981e9b63eb3122e16f317cf2d3df915da0 # Parent 3a708f113f55490ddbbfc6887e8c0ee8463aab07 refactored Sanders code somewhat diff -r 3a708f113f55 -r 3e74cc981e9b client.c --- a/client.c Wed Jul 19 13:36:04 2006 +0200 +++ b/client.c Wed Jul 19 13:52:31 2006 +0200 @@ -315,9 +315,9 @@ *c->w = c->maxw; if(c->maxh && *c->h > c->maxh) *c->h = c->maxh; - if(sticky == TopRight || sticky == BottomRight) + if(sticky == TopRight || sticky == BotRight) *c->x = right - *c->w; - if(sticky == BottomLeft || sticky == BottomRight) + if(sticky == BotLeft || sticky == BotRight) *c->y = bottom - *c->h; resizetitle(c); XSetWindowBorderWidth(dpy, c->win, 1); diff -r 3a708f113f55 -r 3e74cc981e9b dwm.h --- a/dwm.h Wed Jul 19 13:36:04 2006 +0200 +++ b/dwm.h Wed Jul 19 13:52:31 2006 +0200 @@ -25,9 +25,9 @@ /********** CUSTOMIZE **********/ typedef union Arg Arg; +typedef struct Client Client; typedef enum Corner Corner; typedef struct DC DC; -typedef struct Client Client; typedef struct Fnt Fnt; typedef struct Key Key; typedef struct Rule Rule; @@ -44,7 +44,7 @@ /* cursor */ enum { CurNormal, CurResize, CurMove, CurLast }; -enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }; +enum Corner { TopLeft, TopRight, BotLeft, BotRight }; struct Fnt { int ascent; diff -r 3a708f113f55 -r 3e74cc981e9b event.c --- a/event.c Wed Jul 19 13:36:04 2006 +0200 +++ b/event.c Wed Jul 19 13:52:31 2006 +0200 @@ -114,17 +114,10 @@ *c->h = abs(ocy - ev.xmotion.y); *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; - if(ocx <= ev.xmotion.x) { - if(ocy <= ev.xmotion.y) - sticky = TopLeft; - else - sticky = BottomLeft; - } else { - if(ocy <= ev.xmotion.y) - sticky = TopRight; - else - sticky = BottomRight; - } + if(ocx <= ev.xmotion.x) + sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; + else + sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; resize(c, True, sticky); break; case ButtonRelease: