mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-08 08:21:16 -04:00
修复tag rule
修复tag rule
This commit is contained in:
parent
2dfc4fda11
commit
91d37b1d09
2 changed files with 14 additions and 7 deletions
13
maomao.c
13
maomao.c
|
|
@ -1202,7 +1202,6 @@ arrange(Monitor *m, bool want_animation) {
|
||||||
if (!m->wlr_output->enabled)
|
if (!m->wlr_output->enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
if (c->iskilling)
|
if (c->iskilling)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -2073,11 +2072,20 @@ createmon(struct wl_listener *listener, void *data) {
|
||||||
m->pertag = calloc(1, sizeof(Pertag));
|
m->pertag = calloc(1, sizeof(Pertag));
|
||||||
m->pertag->curtag = m->pertag->prevtag = 1;
|
m->pertag->curtag = m->pertag->prevtag = 1;
|
||||||
|
|
||||||
for (i = 0; i <= LENGTH(tags); i++) {
|
for (i = 1; i <= LENGTH(tags); i++) {
|
||||||
m->pertag->nmasters[i] = m->nmaster;
|
m->pertag->nmasters[i] = m->nmaster;
|
||||||
m->pertag->mfacts[i] = m->mfact;
|
m->pertag->mfacts[i] = m->mfact;
|
||||||
|
|
||||||
m->pertag->ltidxs[i] = m->lt;
|
m->pertag->ltidxs[i] = m->lt;
|
||||||
|
|
||||||
|
if(strlen(config.tags[i-1].layout_name) > 0) {
|
||||||
|
for (jk = 0; jk < LENGTH(layouts); jk++) {
|
||||||
|
if(strcmp(layouts[jk].name , config.tags[i-1].layout_name) == 0) {
|
||||||
|
m->pertag->ltidxs[i] = &layouts[jk];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printstatus();
|
printstatus();
|
||||||
|
|
@ -5556,7 +5564,6 @@ void view(const Arg *arg, bool want_animation) {
|
||||||
if (!selmon || (arg->ui != ~0 && selmon->isoverview)) {
|
if (!selmon || (arg->ui != ~0 && selmon->isoverview)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((selmon->tagset[selmon->seltags] & arg->ui & TAGMASK) != 0) {
|
if ((selmon->tagset[selmon->seltags] & arg->ui & TAGMASK) != 0) {
|
||||||
want_animation = false;
|
want_animation = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ typedef struct {
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int id;
|
int id;
|
||||||
char name[256];
|
char layout_name[256];
|
||||||
} tags[9];
|
} tags[9];
|
||||||
|
|
||||||
ConfigWinRule *window_rules;
|
ConfigWinRule *window_rules;
|
||||||
|
|
@ -494,11 +494,11 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
}
|
}
|
||||||
} else if (strcmp(key, "tags") == 0) {
|
} else if (strcmp(key, "tags") == 0) {
|
||||||
int id;
|
int id;
|
||||||
char name[256];
|
char layout_name[256];
|
||||||
if (sscanf(value, "id:%d,name:%255[^\n]", &id, name) == 2) {
|
if (sscanf(value, "id:%d,layout_name:%255[^\n]", &id, layout_name) == 2) {
|
||||||
if (id >= 1 && id <= 9) {
|
if (id >= 1 && id <= 9) {
|
||||||
config->tags[id - 1].id = id;
|
config->tags[id - 1].id = id;
|
||||||
strncpy(config->tags[id - 1].name, name, sizeof(config->tags[id - 1].name));
|
strncpy(config->tags[id - 1].layout_name, layout_name, sizeof(config->tags[id - 1].layout_name));
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Error: Invalid tag id: %d\n", id);
|
fprintf(stderr, "Error: Invalid tag id: %d\n", id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue