On Thu, Jan 12, 2012 at 07:39:53AM +0100, Anselm R Garbe wrote: > I applied your two patches to tip, this needs to be tested for side effects > now.
Ok, I ran into trouble pretty fast. Since the floating windows are never raised in restack() they won't get raised during normal interaction either. I attached a somewhat ugly patch to correct the behavior, but there might be consequences, too. Instead of simply adding XRaiseWindow() I replaced calls to restack() in focusstack(), movemouse(), and resizemouse(). I assume restacking isn't needed there and the calls to restack() simple where a glorified XRaiseWindow() anyway, but I'm not too familiar with the dwm code, so I might be wrong. -- Eckehard Berns
diff -r 070112b7435f dwm.c --- a/dwm.c Thu Jan 12 07:36:05 2012 +0100 +++ b/dwm.c Thu Jan 12 22:07:34 2012 +0100 @@ -907,7 +907,8 @@ } if(c) { focus(c); - restack(selmon); + if (selmon->sel->isfloating) + XRaiseWindow(dpy, selmon->sel->win); } } @@ -1227,7 +1228,7 @@ if(!(c = selmon->sel)) return; - restack(selmon); + XRaiseWindow(dpy, selmon->sel->win); ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, @@ -1371,7 +1372,7 @@ if(!(c = selmon->sel)) return; - restack(selmon); + XRaiseWindow(dpy, selmon->sel->win); ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, @@ -1738,9 +1739,11 @@ if(!selmon->sel) return; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if(selmon->sel->isfloating) + if(selmon->sel->isfloating) { resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h, False); + XRaiseWindow(dpy, selmon->sel->win); + } arrange(selmon); }