summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorEric Pruitt <eric.pruitt@gmail.com>2016-05-25 16:33:11 -0700
committerAnselm R Garbe <anselm@garbe.us>2016-06-24 05:38:58 +0200
commitcd2d7549b3ae5ec234b45d85608f79f4d3aaa851 (patch)
treead0ff250266c4fbe6f9125de922bab75ac95cdde /dwm.c
parentfix fullscreen clients not resized on X display resolution change (diff)
downloaddwm-cd2d7549b3ae5ec234b45d85608f79f4d3aaa851.tar.gz
dwm-cd2d7549b3ae5ec234b45d85608f79f4d3aaa851.zip
Configure geometry before applying rules
Configuring geometry before applying rules makes it possible to have more complex constraints in applyrules that depend on the initial window dimensions and location.
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index ff7e096..9585683 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1043,6 +1043,13 @@ manage(Window w, XWindowAttributes *wa)
1043 1043
1044 c = ecalloc(1, sizeof(Client)); 1044 c = ecalloc(1, sizeof(Client));
1045 c->win = w; 1045 c->win = w;
1046 /* geometry */
1047 c->x = c->oldx = wa->x;
1048 c->y = c->oldy = wa->y;
1049 c->w = c->oldw = wa->width;
1050 c->h = c->oldh = wa->height;
1051 c->oldbw = wa->border_width;
1052
1046 updatetitle(c); 1053 updatetitle(c);
1047 if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { 1054 if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
1048 c->mon = t->mon; 1055 c->mon = t->mon;
@@ -1051,12 +1058,6 @@ manage(Window w, XWindowAttributes *wa)
1051 c->mon = selmon; 1058 c->mon = selmon;
1052 applyrules(c); 1059 applyrules(c);
1053 } 1060 }
1054 /* geometry */
1055 c->x = c->oldx = wa->x;
1056 c->y = c->oldy = wa->y;
1057 c->w = c->oldw = wa->width;
1058 c->h = c->oldh = wa->height;
1059 c->oldbw = wa->border_width;
1060 1061
1061 if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) 1062 if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
1062 c->x = c->mon->mx + c->mon->mw - WIDTH(c); 1063 c->x = c->mon->mx + c->mon->mw - WIDTH(c);