mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-27 07:58:53 -04:00
opt: optimize scroll judge when open new client
This commit is contained in:
parent
b061488dd2
commit
c3693a1ffb
2 changed files with 2 additions and 4 deletions
|
|
@ -301,8 +301,7 @@ void scroller(Monitor *m) {
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
c = tempClients[i];
|
c = tempClients[i];
|
||||||
if (root_client == c) {
|
if (root_client == c) {
|
||||||
if ((!c->is_pending_open_animation || !animations) &&
|
if (c->geom.x >= m->w.x + scroller_structs &&
|
||||||
c->geom.x >= m->w.x + scroller_structs &&
|
|
||||||
c->geom.x + c->geom.width <=
|
c->geom.x + c->geom.width <=
|
||||||
m->w.x + m->w.width - scroller_structs) {
|
m->w.x + m->w.width - scroller_structs) {
|
||||||
need_scroller = false;
|
need_scroller = false;
|
||||||
|
|
|
||||||
|
|
@ -263,8 +263,7 @@ void vertical_scroller(Monitor *m) {
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
c = tempClients[i];
|
c = tempClients[i];
|
||||||
if (root_client == c) {
|
if (root_client == c) {
|
||||||
if ((!c->is_pending_open_animation || !animations) &&
|
if (c->geom.y >= m->w.y + scroller_structs &&
|
||||||
c->geom.y >= m->w.y + scroller_structs &&
|
|
||||||
c->geom.y + c->geom.height <=
|
c->geom.y + c->geom.height <=
|
||||||
m->w.y + m->w.height - scroller_structs) {
|
m->w.y + m->w.height - scroller_structs) {
|
||||||
need_scroller = false;
|
need_scroller = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue