feat: add tagrule option no_hide

This commit is contained in:
DreamMaoMao 2025-09-25 11:09:52 +08:00
parent 2a11357ead
commit 1442d2cb2b
3 changed files with 11 additions and 1 deletions

View file

@ -132,6 +132,7 @@ typedef struct {
char *layout_name; // 布局名称
char *monitor_name;
int no_render_border;
int no_hide;
} ConfigTagRule;
typedef struct {
@ -1387,6 +1388,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, ",");
@ -2869,6 +2872,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;
}
}
}

View file

@ -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) ||

View file

@ -801,6 +801,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 */
};
@ -2618,6 +2619,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;
}
}
}