opt: redetect pointer enter after animaiton end

This commit is contained in:
DreamMaoMao 2025-02-13 16:49:51 +08:00
parent 65b7174487
commit 7b2db2a464

11
main.c
View file

@ -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++;