diff --git a/src/maomao.c b/src/maomao.c index 32c04381..aef5ed3f 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -7058,6 +7058,18 @@ void toggleoverview(const Arg *arg) { unsigned int target; unsigned int visible_client_number = 0; + if (selmon->isoverview) { + for (i = 1; i <= LENGTH(tags); i++) { + remove_workspace(i, selmon); + } + add_workspace(0, selmon); + } else { + remove_workspace(0, selmon); + for (i = 1; i <= LENGTH(tags); i++) { + add_workspace(i, selmon); + } + } + if (selmon->isoverview) { wl_list_for_each(c, &clients, link) if (c && c->mon == selmon && @@ -7097,18 +7109,6 @@ void toggleoverview(const Arg *arg) { } } - if (selmon->isoverview) { - for (i = 1; i <= LENGTH(tags); i++) { - remove_workspace(i, selmon); - } - add_workspace(0, selmon); - } else { - remove_workspace(0, selmon); - for (i = 1; i <= LENGTH(tags); i++) { - add_workspace(i, selmon); - } - } - view(&(Arg){.ui = target}, false); if (ov_tab_mode && selmon->isoverview && selmon->sel) {