[dev] [dwm] Fix for border drawing problem

From: Andreas Amann <amann_AT_physik.tu-berlin.de>
Date: Tue, 29 Jun 2010 16:42:18 +0200

This recent patch

changeset: 1519:72272822ddf2
user: Anselm R Garbe <anselm_AT_garbe.us>
date: Sun May 30 10:02:56 2010 +0100
summary: implemented better fullscreen handling, please test

gives me troubles because the border around the window is not painted for
all clients. (One particular example is emacs from recent bzr repository.)
The reason seems to be that some clients toggle out of fullscreen, before
they have actually toggled into it. This confuses dwm apparently because in
this case c->oldbw is sometimes not correctly initialised.

The following patch fixes this for me:

---------------------
diff --git a/dwm.c b/dwm.c
--- a/dwm.c
+++ b/dwm.c
@@ -1124,7 +1124,6 @@
        c->y = c->oldy = wa->y + c->mon->wy;
        c->w = c->oldw = wa->width;
        c->h = c->oldh = wa->height;
- c->oldbw = wa->border_width;
        if(c->w == c->mon->mw && c->h == c->mon->mh) {
                c->isfloating = 1;
                c->x = c->mon->mx;
@@ -1142,7 +1141,7 @@
                           && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww))
? bh : c->mon->my);
                c->bw = borderpx;
        }
- wc.border_width = c->bw;
+ wc.border_width = c->oldbw = c->bw;
        XConfigureWindow(dpy, w, CWBorderWidth, &wc);
        XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
        configure(c); /* propagates border_width, if size doesn't change */
---------------------

While this seems to work, a proper way of handling fullscreen is probably by
introducing a simple c->fullscreen flag, which could replace the
c->old{x,y,w,h,bw} stuff?

Andreas
Received on Tue Jun 29 2010 - 14:42:18 UTC

This archive was generated by hypermail 2.2.0 : Tue Jun 29 2010 - 14:48:02 UTC