> just one annoying issue with floating apps. eg. running save as in gimp,
> will open a window in the background.

Oh man, sorry. I should've tested it more with floating windows.

So arrange calls arrangemon, which calls restack, but the new floating
window hasn't become selmon->sel yet.

Restacking again at the end of manage fixes it, but then there's
another redraw. To prevent the first restack, maybe something like
the attached patch? Or split off (un)select functions from (un)focus,
which also came up in connection to virtual keyboards some time ago.

Regards,
Peter
--- dwm/dwm.c.orig      2011-07-10 02:34:59.982409153 +0200
+++ dwm/dwm.c   2011-07-10 03:49:19.114387186 +0200
@@ -1150,9 +1150,12 @@ manage(Window w, XWindowAttributes *wa)
        attachstack(c);
        XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* 
some windows require this */
        setclientstate(c, NormalState);
+       unfocus(selmon->sel, False);
+       selmon->sel = NULL;
        arrange(c->mon);
        XMapWindow(dpy, c->win);
        focus(c);
+       restack(c->mon);
 }
 
 void

Reply via email to