From a0824c05df5482fde37898b9a5d81f779167b60e Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 20 Nov 2025 22:47:12 +0800 Subject: [PATCH] opt: optimize scroll judge when open new client --- src/layout/horizontal.h | 3 +-- src/layout/vertical.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 99bb092..2385c84 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -301,8 +301,7 @@ void scroller(Monitor *m) { for (i = 0; i < n; i++) { c = tempClients[i]; if (root_client == c) { - if ((!c->is_pending_open_animation || !animations) && - c->geom.x >= m->w.x + scroller_structs && + if (c->geom.x >= m->w.x + scroller_structs && c->geom.x + c->geom.width <= m->w.x + m->w.width - scroller_structs) { need_scroller = false; diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 5cc8ceb..7eb9529 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -263,8 +263,7 @@ void vertical_scroller(Monitor *m) { for (i = 0; i < n; i++) { c = tempClients[i]; if (root_client == c) { - if ((!c->is_pending_open_animation || !animations) && - c->geom.y >= m->w.y + scroller_structs && + if (c->geom.y >= m->w.y + scroller_structs && c->geom.y + c->geom.height <= m->w.y + m->w.height - scroller_structs) { need_scroller = false;