removed tagmonsilent (haven't figured out how to do this right yet)

This commit is contained in:
lilly-lizard 2026-04-14 14:32:17 +12:00
parent cd83239be4
commit def7376912
No known key found for this signature in database
GPG key ID: B5857277126B5D1C
2 changed files with 11 additions and 30 deletions

View file

@ -22,7 +22,6 @@ int32_t togglefullscreen(const Arg *arg);
int32_t togglemaximizescreen(const Arg *arg); int32_t togglemaximizescreen(const Arg *arg);
int32_t togglegaps(const Arg *arg); int32_t togglegaps(const Arg *arg);
int32_t tagmon(const Arg *arg); int32_t tagmon(const Arg *arg);
int32_t tagmonsilent(const Arg *arg);
int32_t spawn(const Arg *arg); int32_t spawn(const Arg *arg);
int32_t spawn_shell(const Arg *arg); int32_t spawn_shell(const Arg *arg);
int32_t spawn_on_empty(const Arg *arg); int32_t spawn_on_empty(const Arg *arg);

View file

@ -1099,7 +1099,7 @@ int32_t tag(const Arg *arg) {
return 0; return 0;
} }
int32_t tagmon_general(const Arg *arg, bool silent) { int32_t tagmon(const Arg *arg) {
Monitor *m = NULL, *cm = NULL; Monitor *m = NULL, *cm = NULL;
if (!selmon) if (!selmon)
return 0; return 0;
@ -1131,9 +1131,7 @@ int32_t tagmon_general(const Arg *arg, bool silent) {
uint32_t target; uint32_t target;
if (c->mon == m) { if (c->mon == m) {
if (!silent) { view(&(Arg){.ui = newtags}, true);
view(&(Arg){.ui = newtags}, true);
}
return 0; return 0;
} }
@ -1141,15 +1139,11 @@ int32_t tagmon_general(const Arg *arg, bool silent) {
selmon->sel = NULL; selmon->sel = NULL;
} }
setmon(c, m, newtags, !silent); setmon(c, m, newtags, true);
client_update_oldmonname_record(c, m); client_update_oldmonname_record(c, m);
reset_foreign_tolevel(c); reset_foreign_tolevel(c);
if (silent) {
focusclient(focustop(selmon), 1);
}
c->float_geom.width = c->float_geom.width =
(int32_t)(c->float_geom.width * c->mon->w.width / selmon->w.width); (int32_t)(c->float_geom.width * c->mon->w.width / selmon->w.width);
c->float_geom.height = c->float_geom.height =
@ -1161,35 +1155,23 @@ int32_t tagmon_general(const Arg *arg, bool silent) {
// 重新计算居中的坐标 // 重新计算居中的坐标
if (c->isfloating) { if (c->isfloating) {
c->geom = c->float_geom; c->geom = c->float_geom;
if (!silent) { target = get_tags_first_tag(c->tags);
target = get_tags_first_tag(c->tags); view(&(Arg){.ui = target}, true);
view(&(Arg){.ui = target}, true); focusclient(c, 1);
focusclient(c, 1);
}
resize(c, c->geom, 1); resize(c, c->geom, 1);
} else { } else {
if (!silent) { selmon = c->mon;
target = get_tags_first_tag(c->tags); target = get_tags_first_tag(c->tags);
view(&(Arg){.ui = target}, true); view(&(Arg){.ui = target}, true);
focusclient(c, 1); focusclient(c, 1);
}
arrange(selmon, false, false); arrange(selmon, false, false);
} }
if (config.warpcursor && !silent) { if (config.warpcursor) {
warp_cursor_to_selmon(c->mon); warp_cursor_to_selmon(c->mon);
} }
return 0; return 0;
} }
int32_t tagmon(const Arg *arg) {
return tagmon_general(arg, false);
}
int32_t tagmonsilent(const Arg *arg) {
return tagmon_general(arg, true);
}
int32_t tagsilent(const Arg *arg) { int32_t tagsilent(const Arg *arg) {
Client *fc = NULL; Client *fc = NULL;
Client *target_client = NULL; Client *target_client = NULL;