summaryrefslogtreecommitdiffhomepage
path: root/patch/decorationhints.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-11 10:17:02 +0200
committerbakkeby <[email protected]>2020-08-11 10:17:02 +0200
commit10f4d513ec5df78db1c2b83706c208c3032e64ca (patch)
treef4d973870d2583b491f217648ecdf8d25322f405 /patch/decorationhints.c
parent14e148be2a3dbcfd20cbf7c8f58c1c543f63c4b7 (diff)
downloaddwm-flexipatch-10f4d513ec5df78db1c2b83706c208c3032e64ca.tar.gz
dwm-flexipatch-10f4d513ec5df78db1c2b83706c208c3032e64ca.zip
Adding decoration hints patch
Diffstat (limited to 'patch/decorationhints.c')
-rw-r--r--patch/decorationhints.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/patch/decorationhints.c b/patch/decorationhints.c
new file mode 100644
index 0000000..a7498ee
--- /dev/null
+++ b/patch/decorationhints.c
@@ -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);
+ }
+} \ No newline at end of file