From b623b234e3d716b5dd59b445e81741cdd8d81d26 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sun, 22 Feb 2015 22:09:23 -0500 Subject: [PATCH] fix: show (opaque) slave when floater has focused Previously there was a bug where it was tabified when a floater was focused. In addition to correcting the placement of the first slave window, it is made opaque when a floater has focus. The master window has this behavior already, and why not the slave too? The primary use-case for behavior (going opaque when a floater has focus) is dialogs that show "live changes" in the main window, such as the "Colorize..." dialog in the gimp. --- dwm.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dwm.c b/dwm.c index 362e902..6f43444 100644 --- 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; -- 1.7.10.4