aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README1
-rw-r--r--README.org1
-rw-r--r--config.h10
-rw-r--r--dwm.c16
4 files changed, 20 insertions, 8 deletions
diff --git a/README b/README
index 383235a..a231312 100644
--- a/README
+++ b/README
@@ -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:
diff --git a/README.org b/README.org
index 67a92a8..221eec5 100644
--- a/README.org
+++ b/README.org
@@ -60,6 +60,7 @@ List of patches in use:
- /noborder/
- /pertag/
- /restartsig/
+- /sizehints/
- /tagothermon/
My own autostart script can be found under my
diff --git a/config.h b/config.h
index afb9d5f..6e95064 100644
--- a/config.h
+++ b/config.h
@@ -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) */
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