On 20.02.12, Uli Armbruster wrote:
> By default, floating clients are always on top of tiled clients. I'd 
> like to change this behavior to make it possible to use floating and 
> tiled clients together (either having the same tag or if multiple tags 
> are selected) so the currently selected client is on top, no matter if 
> it's floating or tiled.
> 
> So, where can I find this in the source code?

The first attached patch does the trick, but only when using the 
keyboard mappings (mod-[jk], focusstack).

The second one adds the behaviour for sloppy focus.

Bert
diff -rup dwm-6.0-orig/dwm.c dwm-6.0/dwm.c
--- dwm-6.0-orig/dwm.c  2011-12-19 22:22:25.000000000 +0100
+++ dwm-6.0/dwm.c       2012-02-23 20:48:28.000000000 +0100
@@ -1420,13 +1420,12 @@ restack(Monitor *m) {
        drawbar(m);
        if(!m->sel)
                return;
-       if(m->sel->isfloating || !m->lt[m->sellt]->arrange)
-               XRaiseWindow(dpy, m->sel->win);
+       XRaiseWindow(dpy, m->sel->win);
        if(m->lt[m->sellt]->arrange) {
                wc.stack_mode = Below;
                wc.sibling = m->barwin;
                for(c = m->stack; c; c = c->snext)
-                       if(!c->isfloating && ISVISIBLE(c)) {
+                       if(c != m->sel && !c->isfloating && ISVISIBLE(c)) {
                                XConfigureWindow(dpy, c->win, 
CWSibling|CWStackMode, &wc);
                                wc.sibling = c->win;
                        }
diff -rup dwm-6.0-orig/dwm.c dwm-6.0/dwm.c
--- dwm-6.0-orig/dwm.c  2011-12-19 22:22:25.000000000 +0100
+++ dwm-6.0/dwm.c       2012-02-23 21:00:26.000000000 +0100
@@ -456,6 +456,7 @@ buttonpress(XEvent *e) {
        }
        else if((c = wintoclient(ev->window))) {
                focus(c);
+               restack(selmon);
                click = ClkClientWin;
        }
        for(i = 0; i < LENGTH(buttons); i++)
@@ -829,6 +830,7 @@ enternotify(XEvent *e) {
        else if(!c || c == selmon->sel)
                return;
        focus(c);
+       restack(selmon);
 }
 
 void

Reply via email to