#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
#define LENGTH(x) (sizeof x / sizeof x[0])
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
#define LENGTH(x) (sizeof x / sizeof x[0])
Window root, barwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
#define TAGSZ (LENGTH(tags) * sizeof(Bool))
Window root, barwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
#define TAGSZ (LENGTH(tags) * sizeof(Bool))
XGetClassHint(dpy, c->win, &ch);
for(i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
XGetClassHint(dpy, c->win, &ch);
for(i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
- if((r->title && strstr(c->name, r->title))
- || (ch.res_class && r->class && strstr(ch.res_class, r->class))
- || (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
- {
+ if((!r->title || strstr(c->name, r->title))
+ && (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
+ && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
font_extents = XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
font_extents = XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
- if(dc.font.ascent < (*xfonts)->ascent)
- dc.font.ascent = (*xfonts)->ascent;
- if(dc.font.descent < (*xfonts)->descent)
- dc.font.descent = (*xfonts)->descent;
+ dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent);
+ dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent);
c->x = wx + ww - c->w - 2 * c->bw;
if(c->y + c->h + 2 * c->bw > wy + wh)
c->y = wy + wh - c->h - 2 * c->bw;
c->x = wx + ww - c->w - 2 * c->bw;
if(c->y + c->h + 2 * c->bw > wy + wh)
c->y = wy + wh - c->h - 2 * c->bw;
resize(c, mox, moy, mow - 2 * c->bw, moh - 2 * c->bw, RESIZEHINTS);
}
resize(c, mox, moy, mow - 2 * c->bw, moh - 2 * c->bw, RESIZEHINTS);
}
- if((nw = ev.xmotion.x - ocx - 2 * c->bw + 1) <= 0)
- nw = 1;
- if((nh = ev.xmotion.y - ocy - 2 * c->bw + 1) <= 0)
- nh = 1;
+ nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
+ nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
if(!c->isfloating && !lt->isfloating && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
togglefloating(NULL);
if((lt->isfloating) || c->isfloating)
if(!c->isfloating && !lt->isfloating && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
togglefloating(NULL);
if((lt->isfloating) || c->isfloating)