From 766adc4c10d9ebd0bb96fb4cabcb08bc0e4d4e26 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 28 Jun 2025 12:43:28 +0800 Subject: [PATCH] feat: add vertical scroller lock to pointer focus --- src/maomao.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/maomao.c b/src/maomao.c index b9a1b08..251f6e1 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -4842,7 +4842,9 @@ void motionnotify(unsigned int time, struct wlr_input_device *device, double dx, if (c && c->mon && !c->animation.running && (!(c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width || - c->geom.x < c->mon->m.x) || + c->geom.x < c->mon->m.x || + c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height || + c->geom.y < c->mon->m.y) || !ISTILED(c))) { scroller_focus_lock = 0; } @@ -4851,10 +4853,14 @@ void motionnotify(unsigned int time, struct wlr_input_device *device, double dx, if (!scroller_focus_lock || !(c && c->mon && (c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width || - c->geom.x < c->mon->m.x))) { + c->geom.x < c->mon->m.x || + c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height || + c->geom.y < c->mon->m.y))) { if (c && c->mon && is_scroller_layout(c->mon) && (c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width || - c->geom.x < c->mon->m.x)) { + c->geom.x < c->mon->m.x || + c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height || + c->geom.y < c->mon->m.y)) { should_lock = true; } pointerfocus(c, surface, sx, sy, time);