From 407fbb6dae377be1d40fde3301dfa118be81fea9 Mon Sep 17 00:00:00 2001 From: InauguralPhysicist Date: Tue, 14 Jul 2026 01:04:59 -0500 Subject: [PATCH] fix(gfx): add the missing state field to SDL_MouseMotionEvent (#599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hand-rolled struct omitted SDL2's Uint32 state (button mask), so motion.x read the button state and motion.y read the true x — every real-mouse drag and hover in every gfx app decoded garbage, while clicks (correctly-declared button struct) and all synthesized-event tests passed. Found live in DeslanStudio: timeline drags were no-ops and a trim clamped a user's clip to a sliver. Verified with xdotool-driven real input before/after. Closes #599 Co-Authored-By: Claude Fable 5 --- src/ext_gfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext_gfx.c b/src/ext_gfx.c index 2b986a1..b69d193 100644 --- a/src/ext_gfx.c +++ b/src/ext_gfx.c @@ -25,7 +25,7 @@ typedef int32_t Sint32; typedef struct { int x, y, w, h; } SDL_Rect; typedef struct { Sint32 scancode; Sint32 sym; uint16_t mod; Uint32 unused; } SDL_Keysym; typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint8 state; Uint8 rep; Uint8 p2; Uint8 p3; SDL_Keysym keysym; } SDL_KeyboardEvent; -typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint32 which; Sint32 x; Sint32 y; Sint32 xrel; Sint32 yrel; } SDL_MouseMotionEvent; +typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint32 which; Uint32 state; Sint32 x; Sint32 y; Sint32 xrel; Sint32 yrel; } SDL_MouseMotionEvent; /* state (button mask) was missing: x/y decoded misaligned, breaking every real-mouse drag/hover (#599) */ typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint32 which; Uint8 button; Uint8 state; Uint8 clicks; Uint8 p1; Sint32 x; Sint32 y; } SDL_MouseButtonEvent; typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint32 which; Sint32 x; Sint32 y; Uint32 direction; } SDL_MouseWheelEvent; typedef struct { Uint32 type; Uint32 ts; Uint32 wid; Uint8 event; Uint8 p1; Uint8 p2; Uint8 p3; Sint32 data1; Sint32 data2; } SDL_WindowEvent;