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); }