/*
* B1 Grow window a little
- * B1 Drag: Resize vertically or move to column
+ ** B1 Drag: Resize vertically or move to column
* B2: Stack windows with titlebars visible but only one window expanded
* B3: Maximize in column
* B1+B2: Kill window
static void xbtnpress(XConf* x, XEvent* e) {
printf("btn\n");
Client* c = client_find(e->xbutton.window);
- if (c && c->frame == e->xbutton.window) {
+ if (!c || c->frame != e->xbutton.window)
+ return;
+
+ if (Button1 == e->xbutton.button) {
XDefineCursor(X.display, e->xbutton.window, Move_Cursor);
StartY = e->xbutton.y;
+ } else if (Button2 == e->xbutton.button) {
+ if (e->xbutton.state & (1 << (Button1 + 7)))
+ puts("kill");
+ else
+ puts("grow");
+ } else if (Button3 == e->xbutton.button) {
+ puts("maximize");
}
+
XSync(X.display, False);
}
static void xbtnrelease(XConf* x, XEvent* e) {
printf("btn\n");
Client* c = client_find(e->xbutton.window);
- if (c && c->frame == e->xbutton.window) {
+ if (!c || c->frame != e->xbutton.window)
+ return;
+
+ if (Button1 == e->xbutton.button) {
XUndefineCursor(X.display, e->xbutton.window);
printf("moved: %d\n", e->xbutton.y - StartY);
client_resize(x, c, e->xbutton.y - StartY);
}
+
XSync(X.display, False);
}