dwm/patch/decorationhints.c

38 lines
943 B
C
Raw Normal View History

2020-08-11 10:17:02 +02:00
static Atom motifatom;
void
updatemotifhints(Client *c)
{
Atom real;
int format;
unsigned char *p = NULL;
unsigned long n, extra;
unsigned long *motif;
int width, height;
if (!decorhints)
return;
if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom,
2020-08-27 21:05:34 +02:00
&real, &format, &n, &extra, &p) == Success && p != NULL) {
2020-08-11 10:17:02 +02:00
motif = (unsigned long*)p;
if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) {
width = WIDTH(c);
height = HEIGHT(c);
if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL ||
2020-08-27 21:05:34 +02:00
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
#if SETBORDERPX_PATCH
c->bw = c->oldbw = c->mon->borderpx;
#else
2020-08-11 10:17:02 +02:00
c->bw = c->oldbw = borderpx;
2020-08-27 21:05:34 +02:00
#endif // SETBORDERPX_PATCH
2020-08-11 10:17:02 +02:00
else
c->bw = c->oldbw = 0;
resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0);
}
XFree(p);
}
}