diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-12 17:11:33 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-12 17:11:33 +0100 |
commit | a5e9038297516dd47726394c7223bab793718f6f (patch) | |
tree | cc81ded559f9dcac8b142270e17ed9d27ed46350 | |
parent | Tags update (diff) | |
download | dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.gz dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.bz2 dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.xz dwm-a5e9038297516dd47726394c7223bab793718f6f.tar.zst dwm-a5e9038297516dd47726394c7223bab793718f6f.zip |
Added sizehints patch
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | README.org | 1 | ||||
-rw-r--r-- | config.h | 10 | ||||
-rw-r--r-- | dwm.c | 16 |
4 files changed, 20 insertions, 8 deletions
@@ -63,6 +63,7 @@ List of patches in use: - noborder - pertag - restartsig + - sizehints - tagothermon My own autostart script can be found under my dotfiles-bsd repository: @@ -60,6 +60,7 @@ List of patches in use: - /noborder/ - /pertag/ - /restartsig/ +- /sizehints/ - /tagothermon/ My own autostart script can be found under my @@ -34,11 +34,11 @@ static const Rule rules[] = { * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating monitor */ - { "Firefox", NULL, NULL, 1 << 2, 0, -1 }, - { "st-256color", NULL, NULL, 0, 0, -1 }, - { NULL, NULL, "DergodsRealmII", 0, 1, -1 }, - { NULL, NULL, "Event Tester", 0, 0, -1 }, /* xev */ + /* class instance title tags mask isfloating isfreesize monitor */ + { "Firefox", NULL, NULL, 1 << 2, 0, 0, -1 }, + { "st-256color", NULL, NULL, 0, 0, 0, -1 }, + { NULL, NULL, "DergodsRealmII", 0, 1, 0, -1 }, + { NULL, NULL, "Event Tester", 0, 0, 0, -1 }, /* xev */ }; /* layout(s) */ @@ -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 |