typedef struct Client Client;
struct Client {
char name[256];
+ float mina, maxa;
int x, y, w, h;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
- float mina, maxa;
int bw, oldbw;
- Bool isbanned, isfixed, isfloating, ismoved, isurgent;
uint tags;
+ Bool isbanned, isfixed, isfloating, ismoved, isurgent;
Client *next;
Client *snext;
Window win;
else
click = ClkWinTitle;
}
- else if((c = getclient(ev->window)))
+ else if((c = getclient(ev->window))) {
+ focus(c);
click = ClkClientWin;
+ }
for(i = 0; i < LENGTH(buttons); i++)
if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
if(c->y + c->h + 2 * c->bw > sy + sh)
c->y = sy + sh - c->h - 2 * c->bw;
c->x = MAX(c->x, sx);
- c->y = MAX(c->y, by == 0 ? bh : sy);
+ /* only fix client y-offset, if the client center might cover the bar */
+ c->y = MAX(c->y, ((by == 0) && (c->x + (c->w / 2) >= wx) && (c->x + (c->w / 2) < wx + ww)) ? bh : sy);
c->bw = borderpx;
}
None, cursor[CurMove], CurrentTime) != GrabSuccess)
return;
XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
- if(x1 < c->x || x1 > c->x + c->w || y1 < c->y || y1 > c->y + c->h) {
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, 0, 0);
- x1 = c->x + 1;
- y1 = c->y + 1;
- }
for(;;) {
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
switch (ev.type) {
w = MAX(w, c->minw);
h = MAX(h, c->minh);
-
- if (c->maxw)
+
+ if(c->maxw)
w = MIN(w, c->maxw);
- if (c->maxh)
+ if(c->maxh)
h = MIN(h, c->maxh);
}
if(w <= 0 || h <= 0)