aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-11-12 17:11:33 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-11-12 17:11:33 +0100
commita5e9038297516dd47726394c7223bab793718f6f (patch)
treecc81ded559f9dcac8b142270e17ed9d27ed46350 /dwm.c
parentTags update (diff)
downloaddwm-a5e9038297516dd47726394c7223bab793718f6f.tar.gz
dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.bz2
dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.xz
dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.zst
dwm-a5e9038297516dd47726394c7223bab793718f6f.zip
Added sizehints patch
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index f623f20..3b8f890 100644
--- a/dwm.c
+++ b/dwm.c
@@ -93,7 +93,7 @@ struct Client {
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int bw, oldbw;
unsigned int tags;
- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ int isfixed, isfloating, isfreesize, isurgent, neverfocus, oldstate, isfullscreen;
Client *next;
Client *snext;
Monitor *mon;
@@ -141,6 +141,7 @@ typedef struct {
const char *title;
unsigned int tags;
int isfloating;
+ int isfreesize;
int monitor;
} Rule;
@@ -334,6 +335,7 @@ applyrules(Client *c)
/* rule matching */
c->isfloating = 0;
+ c->isfreesize = 1;
c->tags = 0;
XGetClassHint(dpy, c->win, &ch);
class = ch.res_class ? ch.res_class : broken;
@@ -346,6 +348,7 @@ applyrules(Client *c)
&& (!r->instance || strstr(instance, r->instance)))
{
c->isfloating = r->isfloating;
+ c->isfreesize = r->isfreesize;
c->tags |= r->tags;
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
@@ -2270,7 +2273,7 @@ updatesizehints(Client *c)
if (!XGetWMNormalHints(dpy, c->win, &size, &msize))
/* size is uninitialized, ensure that size.flags aren't used */
- size.flags = PSize;
+ size.flags = 0;
if (size.flags & PBaseSize) {
c->basew = size.base_width;
c->baseh = size.base_height;
@@ -2302,6 +2305,11 @@ updatesizehints(Client *c)
c->maxa = (float)size.max_aspect.x / size.max_aspect.y;
} else
c->maxa = c->mina = 0.0;
+ if((size.flags & PSize) && c->isfreesize) {
+ c->basew = size.base_width;
+ c->baseh = size.base_height;
+ c->isfloating = 1;
+ }
c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
}
@@ -2330,8 +2338,10 @@ updatewindowtype(Client *c)
if (state == netatom[NetWMFullscreen])
setfullscreen(c, 1);
- if (wtype == netatom[NetWMWindowTypeDialog])
+ if (wtype == netatom[NetWMWindowTypeDialog]) {
c->isfloating = 1;
+ c->isfreesize = 1;
+ }
}
void