feat:add arg to keep tag when tagmon

This commit is contained in:
DreamMaoMao 2025-06-15 11:12:47 +08:00
parent 20d132de3f
commit b97222b6b0
2 changed files with 3 additions and 1 deletions

View file

@ -692,6 +692,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
} else if (strcmp(func_name, "tagmon") == 0) {
func = tagmon;
(*arg).i = parse_direction(arg_value);
(*arg).ui = atoi(arg_value2);
} else if (strcmp(func_name, "incgaps") == 0) {
func = incgaps;
(*arg).i = atoi(arg_value);

View file

@ -6702,13 +6702,14 @@ void tagsilent(const Arg *arg) {
void tagmon(const Arg *arg) {
Client *c = focustop(selmon);
unsigned int newtags = arg->ui ? c->tags : 0;
Monitor *m;
if (c) {
if (c == selmon->sel) {
selmon->sel = NULL;
}
m = dirtomon(arg->i);
setmon(c, m, 0, true);
setmon(c, m, newtags, true);
reset_foreign_tolevel(c);
// 重新计算居中的坐标
if (c->isfloating) {