Clear reported drag state on controller release

This commit is contained in:
Codex committed 2026-10-01 22:40:24 -05:00
1 parent 9da8bd5500
commit 1fdb1fd3e5
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; e->screen = c->screen; e->x = c->x; e->y = c->y;
++c->clicks; ++c->clicks;
} }
c->held = false; c->held = false; c->dragging = false;
} else if (e->type == FT_LEAVE && c->held) { } else if (e->type == FT_LEAVE && c->held) {
return false; // Preserve the implicit grab through tiny edge excursions. 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); assert(c.dragging && c.drags==1);
e=event(FT_MOTION,false,101,100);assert(ft_controller_click_filter(&c,&e,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)); 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_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_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); e=event(FT_BUTTON,false,800,900);e.screen=1;ft_controller_click_filter(&c,&e,1);