Adding decoration hints patch
parent
14e148be2a
commit
10f4d513ec
@ -0,0 +1,34 @@
|
||||
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,
|
||||
&real, &format, &n, &extra, &p) == Success && p != NULL) {
|
||||
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 ||
|
||||
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER ||
|
||||
motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE)
|
||||
c->bw = c->oldbw = borderpx;
|
||||
else
|
||||
c->bw = c->oldbw = 0;
|
||||
|
||||
resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0);
|
||||
}
|
||||
XFree(p);
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
#define MWM_HINTS_FLAGS_FIELD 0
|
||||
#define MWM_HINTS_DECORATIONS_FIELD 2
|
||||
#define MWM_HINTS_DECORATIONS (1 << 1)
|
||||
#define MWM_DECOR_ALL (1 << 0)
|
||||
#define MWM_DECOR_BORDER (1 << 1)
|
||||
#define MWM_DECOR_TITLE (1 << 3)
|
||||
|
||||
static void updatemotifhints(Client *c);
|
Loading…
Reference in New Issue