feat: add tag rule option open_as_floating

This commit is contained in:
DreamMaoMao 2026-03-18 23:10:15 +08:00
parent 972af1d41f
commit 0faf29acba
3 changed files with 37 additions and 18 deletions

View file

@ -166,6 +166,7 @@ typedef struct {
float mfact;
int32_t nmaster;
int32_t no_render_border;
int32_t open_as_floating;
int32_t no_hide;
} ConfigTagRule;
@ -1835,6 +1836,7 @@ bool parse_option(Config *config, char *key, char *value) {
rule->nmaster = 0;
rule->mfact = 0.0f;
rule->no_render_border = 0;
rule->open_as_floating = 0;
rule->no_hide = 0;
bool parse_error = false;
@ -1863,6 +1865,8 @@ bool parse_option(Config *config, char *key, char *value) {
rule->monitor_serial = strdup(val);
} else if (strcmp(key, "no_render_border") == 0) {
rule->no_render_border = CLAMP_INT(atoi(val), 0, 1);
} else if (strcmp(key, "open_as_floating") == 0) {
rule->open_as_floating = CLAMP_INT(atoi(val), 0, 1);
} else if (strcmp(key, "no_hide") == 0) {
rule->no_hide = CLAMP_INT(atoi(val), 0, 1);
} else if (strcmp(key, "nmaster") == 0) {
@ -3621,6 +3625,8 @@ void parse_tagrule(Monitor *m) {
m->pertag->mfacts[tr.id] = tr.mfact;
if (tr.no_render_border >= 0)
m->pertag->no_render_border[tr.id] = tr.no_render_border;
if (tr.open_as_floating >= 0)
m->pertag->open_as_floating[tr.id] = tr.open_as_floating;
}
}