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