refactored Sanders code somewhat
This commit is contained in:
parent
79cd408844
commit
8af1d97332
4
client.c
4
client.c
|
@ -315,9 +315,9 @@ resize(Client *c, Bool inc, Corner sticky)
|
||||||
*c->w = c->maxw;
|
*c->w = c->maxw;
|
||||||
if(c->maxh && *c->h > c->maxh)
|
if(c->maxh && *c->h > 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;
|
*c->x = right - *c->w;
|
||||||
if(sticky == BottomLeft || sticky == BottomRight)
|
if(sticky == BotLeft || sticky == BotRight)
|
||||||
*c->y = bottom - *c->h;
|
*c->y = bottom - *c->h;
|
||||||
resizetitle(c);
|
resizetitle(c);
|
||||||
XSetWindowBorderWidth(dpy, c->win, 1);
|
XSetWindowBorderWidth(dpy, c->win, 1);
|
||||||
|
|
4
dwm.h
4
dwm.h
|
@ -25,9 +25,9 @@ enum { Tscratch, Tdev, Twww, Twork, TLast };
|
||||||
/********** CUSTOMIZE **********/
|
/********** CUSTOMIZE **********/
|
||||||
|
|
||||||
typedef union Arg Arg;
|
typedef union Arg Arg;
|
||||||
|
typedef struct Client Client;
|
||||||
typedef enum Corner Corner;
|
typedef enum Corner Corner;
|
||||||
typedef struct DC DC;
|
typedef struct DC DC;
|
||||||
typedef struct Client Client;
|
|
||||||
typedef struct Fnt Fnt;
|
typedef struct Fnt Fnt;
|
||||||
typedef struct Key Key;
|
typedef struct Key Key;
|
||||||
typedef struct Rule Rule;
|
typedef struct Rule Rule;
|
||||||
|
@ -44,7 +44,7 @@ enum { WMProtocols, WMDelete, WMLast };
|
||||||
/* cursor */
|
/* cursor */
|
||||||
enum { CurNormal, CurResize, CurMove, CurLast };
|
enum { CurNormal, CurResize, CurMove, CurLast };
|
||||||
|
|
||||||
enum Corner { TopLeft, TopRight, BottomLeft, BottomRight };
|
enum Corner { TopLeft, TopRight, BotLeft, BotRight };
|
||||||
|
|
||||||
struct Fnt {
|
struct Fnt {
|
||||||
int ascent;
|
int ascent;
|
||||||
|
|
13
event.c
13
event.c
|
@ -114,17 +114,10 @@ resizemouse(Client *c)
|
||||||
*c->h = abs(ocy - ev.xmotion.y);
|
*c->h = abs(ocy - ev.xmotion.y);
|
||||||
*c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
|
*c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
|
||||||
*c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
|
*c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
|
||||||
if(ocx <= ev.xmotion.x) {
|
if(ocx <= ev.xmotion.x)
|
||||||
if(ocy <= ev.xmotion.y)
|
sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft;
|
||||||
sticky = TopLeft;
|
|
||||||
else
|
else
|
||||||
sticky = BottomLeft;
|
sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight;
|
||||||
} else {
|
|
||||||
if(ocy <= ev.xmotion.y)
|
|
||||||
sticky = TopRight;
|
|
||||||
else
|
|
||||||
sticky = BottomRight;
|
|
||||||
}
|
|
||||||
resize(c, True, sticky);
|
resize(c, True, sticky);
|
||||||
break;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
|
|
Loading…
Reference in New Issue