sowm: Set minimum resize amount.

This commit is contained in:
Dylan Araps 2020-02-20 15:59:48 +02:00
parent 5cc5d25823
commit 5547cc3a51
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
2 changed files with 4 additions and 3 deletions

4
sowm.c
View File

@ -58,8 +58,8 @@ void notify_motion(XEvent *e) {
XMoveResizeWindow(d, mouse.subwindow,
wx + (mouse.button == 1 ? xd : 0),
wy + (mouse.button == 1 ? yd : 0),
ww + (mouse.button == 3 ? xd : 0),
wh + (mouse.button == 3 ? yd : 0));
MAX(1, ww + (mouse.button == 3 ? xd : 0)),
MAX(1, wh + (mouse.button == 3 ? yd : 0)));
}
void key_press(XEvent *e) {

3
sowm.h
View File

@ -3,6 +3,7 @@
#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next)
#define ws_save(W) ws_list[W] = list
#define ws_sel(W) list = ws_list[ws = W]
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define win_size(W, gx, gy, gw, gh) \
XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \
@ -12,7 +13,7 @@
#define mod_clean(mask) (mask & ~(numlock|LockMask) & \
(ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
typedef union {
typedef struct {
const char** com;
const int i;
const Window w;