JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix: show (opaque) slave when floater has focused
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 362e902..6f43444 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -317,7 +317,7 @@ update_window_opacities(Monitor *m) {
        }
        for (c = m->clients; c; c = c->next) {
                if (ISVISIBLE(c)) {
-                       if (c->isfloating || c == m->sel || (c == master && selection_floating)) {
+                       if (c->isfloating || c == m->sel || (selection_floating && (c == master || c == slave))) {
                                window_set_opaque(c);
                        } else if (c == master || c == slave) {
                                window_set_translucent(c);
@@ -1778,12 +1778,12 @@ jason_layout(Monitor *m) {
 
        for(tiled_count = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), tiled_count++) {
                if (tiled_count == 0) { // master
-                       if (c == m->sel) {
-                               if (c->next) {
+                       if (c->next) {
+                               if (m->sel && (m->sel == c || m->sel->isfloating || !ISVISIBLE(m->sel))) {
                                        vis_slave = nexttiled(c->next);
+                               } else {
+                                       vis_slave = m->sel;
                                }
-                       } else {
-                               vis_slave = m->sel;
                        }
                } else {
                        if (c == vis_slave) {
@@ -1800,10 +1800,6 @@ jason_layout(Monitor *m) {
        if(tiled_count > 1 || (tiled_count == 1 && !nexttiled(m->clients)->screen_hog)) {
                mw = m->ww * m->mfact;
        } else {
-               // one of these:
-               // * zero tiled windows
-               // * one tiled window that's not a screen hog
-               // * miltiple tiled windows
                mw = m->ww;
        }
        right_width = m->ww - mw;