]> git.lizzy.rs Git - bspwm.git/commitdiff
Honor `single_monocle` in `set_hidden`
authorBastien Dejean <nihilhill@gmail.com>
Fri, 2 Aug 2019 10:18:22 +0000 (12:18 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 2 Aug 2019 10:21:49 +0000 (12:21 +0200)
Fixes #990.

src/tree.c

index 6b522d143207cc627b643f4a5861b5895383dd3b..2aa42ebea586c304f0352b1a4fdee52f2aafbf49 100644 (file)
@@ -1931,6 +1931,14 @@ void set_hidden(monitor_t *m, desktop_t *d, node_t *n, bool value)
                        activate_node(m, d, d->focus);
                }
        }
+
+       if (single_monocle) {
+               if (value && d->layout != LAYOUT_MONOCLE && tiled_count(d->root, true) <= 1) {
+                       set_layout(m, d, LAYOUT_MONOCLE, false);
+               } else if (!value && d->layout == LAYOUT_MONOCLE && tiled_count(d->root, true) > 1) {
+                       set_layout(m, d, d->user_layout, false);
+               }
+       }
 }
 
 void set_hidden_local(monitor_t *m, desktop_t *d, node_t *n, bool value)