From 7b2db2a464ca0eceff72a19850a62a637f4c6baf Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 13 Feb 2025 16:49:51 +0800 Subject: [PATCH] opt: redetect pointer enter after animaiton end --- main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.c b/main.c index 5169dd6..53aea5d 100644 --- a/main.c +++ b/main.c @@ -725,6 +725,9 @@ bool client_animation_next_tick(Client *c) { double animation_passed = (double)c->animation.passed_frames / c->animation.total_frames; double factor = find_animation_curve_at(animation_passed); + Client *pointer_c = NULL; + double sx = 0, sy = 0; + struct wlr_surface *surface = NULL; uint32_t width = c->animation.initial.width + (c->current.width - c->animation.initial.width) * factor; @@ -774,6 +777,14 @@ bool client_animation_next_tick(Client *c) { c->animation.tagouted = true; c->animation.current = c->geom; } + + xytonode(cursor->x, cursor->y, NULL, &pointer_c, NULL, &sx, &sy); + + surface = pointer_c && pointer_c == c ? client_surface(pointer_c) : NULL; + if(surface && pointer_c == selmon->sel) { + wlr_seat_pointer_notify_enter(seat, surface, sx, sy); + } + return false; } else { c->animation.passed_frames++;