feat: add dispatch viewcrossmon and tagcrossmon

This commit is contained in:
DreamMaoMao
2025-10-29 13:06:05 +08:00
parent cbcbda25cd
commit 9b5ea50095
3 changed files with 34 additions and 3 deletions

View File

@@ -1051,11 +1051,17 @@ int tagmon(const Arg *arg) {
return 0;
}
if (!m || !m->wlr_output->enabled || m == c->mon)
if (!m || !m->wlr_output->enabled)
return 0;
unsigned int newtags = arg->ui ? c->tags : 0;
unsigned int newtags = arg->ui ? arg->ui : arg->i2 ? c->tags : 0;
unsigned int target;
if (c->mon == m) {
view(&(Arg){.ui = newtags}, true);
return 0;
}
if (c == selmon->sel) {
selmon->sel = NULL;
}
@@ -1072,6 +1078,7 @@ int tagmon(const Arg *arg) {
selmon = c->mon;
c->float_geom = setclient_coordinate_center(c, c->float_geom, 0, 0);
// 重新计算居中的坐标
// 重新计算居中的坐标
if (c->isfloating) {
c->geom = c->float_geom;
@@ -1415,6 +1422,20 @@ int viewtoright_have_client(const Arg *arg) {
return 0;
}
int viewcrossmon(const Arg *arg) {
focusmon(arg);
view_in_mon(arg, true, selmon, true);
return 0;
}
int tagcrossmon(const Arg *arg) {
if (!selmon->sel)
return 0;
tagmon(&(Arg){.ui = arg->ui, .i = UNDIR, .v = arg->v});
return 0;
}
int comboview(const Arg *arg) {
unsigned int newtags = arg->ui & TAGMASK;