On Thu, Jan 12, 2012 at 10:23:14PM +0100, Eckehard Berns wrote:
> I attached a somewhat ugly patch to correct the behavior, ...
Oops, we need raising in focusstack() not only for floating windows, but
also if we're in a floating layout. Corrected patch is attached.
--
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:27:51 2012 +0100
@@ -907,7 +907,8 @@
}
if(c) {
focus(c);
- restack(selmon);
+ if (selmon->sel->isfloating ||
!selmon->lt[selmon->sellt]->arrange)
+ 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);
}