opt: avoid useless view action

This commit is contained in:
DreamMaoMao 2025-08-27 09:38:22 +08:00
parent 957b24f164
commit 9b144df48d

View file

@ -1202,11 +1202,9 @@ void applyrules(Client *c) {
!c->isopensilent && (!c->istagsilent || !newtags ||
newtags & mon->tagset[mon->seltags]));
if (!c->isopensilent &&
(!c->istagsilent || c->tags & c->mon->tagset[c->mon->seltags]) &&
c->mon &&
((c->mon && c->mon != selmon) ||
!(c->tags & (1 << (c->mon->pertag->curtag - 1))))) {
if (c->mon &&
!(c->mon == selmon && c->tags & c->mon->tagset[c->mon->seltags]) &&
!c->isopensilent && !c->istagsilent) {
c->animation.tag_from_rule = true;
view_in_mon(&(Arg){.ui = c->tags}, true, c->mon);
}
@ -5156,7 +5154,8 @@ urgent(struct wl_listener *listener, void *data) {
return;
if (focus_on_activate && !c->istagsilent && c != selmon->sel) {
view(&(Arg){.ui = c->tags}, true);
if (!(c->mon == selmon && c->tags & c->mon->tagset[c->mon->seltags]))
view(&(Arg){.ui = c->tags}, true);
focusclient(c, 1);
} else if (c != focustop(selmon)) {
if (client_surface(c)->mapped)
@ -5278,7 +5277,8 @@ void activatex11(struct wl_listener *listener, void *data) {
}
if (focus_on_activate && !c->istagsilent && c != selmon->sel) {
view(&(Arg){.ui = c->tags}, true);
if (!(c->mon == selmon && c->tags & c->mon->tagset[c->mon->seltags]))
view(&(Arg){.ui = c->tags}, true);
wlr_xwayland_surface_activate(c->surface.xwayland, 1);
focusclient(c, 1);
need_arrange = false;