Clear reported drag state on controller release

This commit is contained in:
Codex authored and DeeJanuz committed 2026-10-01 23:18:41 -06:00
1 parent 77f28f0922
commit ba6ccdfbd1
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ static inline bool ft_controller_click_filter(struct ft_controller_click *c,
e->screen = c->screen; e->x = c->x; e->y = c->y;
++c->clicks;
}
c->held = false;
c->held = false; c->dragging = false;
} else if (e->type == FT_LEAVE && c->held) {
return false; // Preserve the implicit grab through tiny edge excursions.
}
+1 -1
View File
@@ -18,7 +18,7 @@ int main(void) {
assert(c.dragging && c.drags==1);
e=event(FT_MOTION,false,101,100);assert(ft_controller_click_filter(&c,&e,1));
e=event(FT_BUTTON,false,103,100);assert(ft_controller_click_filter(&c,&e,1));
assert(e.x==103 && c.clicks==1 && !c.held);
assert(e.x==103 && c.clicks==1 && !c.held && !c.dragging);
e=event(FT_BUTTON,true,100,100);ft_controller_click_filter(&c,&e,1);
e=event(FT_LEAVE,false,0,0);assert(!ft_controller_click_filter(&c,&e,1));
e=event(FT_BUTTON,false,800,900);e.screen=1;ft_controller_click_filter(&c,&e,1);