diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 9e6486b..8690dc7 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -131,6 +131,7 @@ typedef struct { char *layout_name; // 布局名称 char *monitor_name; int no_render_border; + int no_hide; } ConfigTagRule; typedef struct { @@ -1327,6 +1328,8 @@ void parse_config_line(Config *config, const char *line) { rule->monitor_name = strdup(val); } else if (strcmp(key, "no_render_border") == 0) { rule->no_render_border = CLAMP_INT(atoi(val), 0, 1); + } else if (strcmp(key, "no_hide") == 0) { + rule->no_hide = CLAMP_INT(atoi(val), 0, 1); } } token = strtok(NULL, ","); @@ -2738,6 +2741,8 @@ void reapply_tagrule(void) { config.tag_rules[i - 1].layout_name) == 0) { m->pertag->ltidxs[config.tag_rules[i - 1].id] = &layouts[jk]; + m->pertag->no_hide[config.tag_rules[i - 1].id] = + config.tag_rules[i - 1].no_hide; } } } diff --git a/src/ext-protocol/ext-workspace.h b/src/ext-protocol/ext-workspace.h index ad8f94e..516a411 100644 --- a/src/ext-protocol/ext-workspace.h +++ b/src/ext-protocol/ext-workspace.h @@ -102,7 +102,9 @@ void dwl_ext_workspace_printstatus(Monitor *m) { wlr_ext_workspace_handle_v1_set_hidden(w->ext_workspace, false); } else { wlr_ext_workspace_handle_v1_set_urgent(w->ext_workspace, false); - wlr_ext_workspace_handle_v1_set_hidden(w->ext_workspace, true); + if (!w->m->pertag->no_hide[w->tag]) + wlr_ext_workspace_handle_v1_set_hidden(w->ext_workspace, + true); } if ((m->tagset[m->seltags] & (1 << (w->tag - 1)) & TAGMASK) || diff --git a/src/mango.c b/src/mango.c index 1549cc5..805243c 100644 --- a/src/mango.c +++ b/src/mango.c @@ -811,6 +811,7 @@ struct Pertag { int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ float smfacts[LENGTH(tags) + 1]; /* smfacts per tag */ + bool no_hide[LENGTH(tags) + 1]; /* no_hide per tag */ const Layout *ltidxs[LENGTH(tags) + 1]; /* matrix of tags and layouts indexes */ }; @@ -2574,6 +2575,8 @@ void createmon(struct wl_listener *listener, void *data) { strcmp(layouts[jk].name, config.tag_rules[i - 1].layout_name) == 0) { m->pertag->ltidxs[config.tag_rules[i - 1].id] = &layouts[jk]; + m->pertag->no_hide[config.tag_rules[i - 1].id] = + config.tag_rules[i - 1].no_hide; } } }