[hackers] [dwm] Configure geometry before applying rules || Eric Pruitt

From: <git_AT_suckless.org>
Date: Fri, 24 Jun 2016 05:39:11 +0200 (CEST)

commit cd2d7549b3ae5ec234b45d85608f79f4d3aaa851
Author: Eric Pruitt <eric.pruitt_AT_gmail.com>
AuthorDate: Wed May 25 16:33:11 2016 -0700
Commit: Anselm R Garbe <anselm_AT_garbe.us>
CommitDate: Fri Jun 24 05:38:58 2016 +0200

    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.

diff --git a/dwm.c b/dwm.c
index ff7e096..9585683 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -1043,6 +1043,13 @@ manage(Window w, XWindowAttributes *wa)
 
         c = ecalloc(1, sizeof(Client));
         c->win = w;
+ /* geometry */
+ c->x = c->oldx = wa->x;
+ c->y = c->oldy = wa->y;
+ c->w = c->oldw = wa->width;
+ c->h = c->oldh = wa->height;
+ c->oldbw = wa->border_width;
+
         updatetitle(c);
         if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
                 c->mon = t->mon;
_AT_@ -1051,12 +1058,6 @@ manage(Window w, XWindowAttributes *wa)
                 c->mon = selmon;
                 applyrules(c);
         }
- /* geometry */
- c->x = c->oldx = wa->x;
- c->y = c->oldy = wa->y;
- c->w = c->oldw = wa->width;
- c->h = c->oldh = wa->height;
- c->oldbw = wa->border_width;
 
         if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
                 c->x = c->mon->mx + c->mon->mw - WIDTH(c);
Received on Fri Jun 24 2016 - 05:39:11 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 24 2016 - 05:48:24 CEST