~mil/mepo

f6fcdbf65c343970914a93abae30b28e91ac6f0a — Miles Alan 11 days ago ab6d728
Resolve issue with SDL 2.0.22 where mouse-autocapturing breaks motion events
See: https://github.com/libsdl-org/SDL/issues/5652
1 files changed, 9 insertions(+), 0 deletions(-)

M src/Mepo.zig
M src/Mepo.zig => src/Mepo.zig +9 -0
@@ 1258,6 1258,15 @@ fn setup_sdl_video_and_window(allocator: std.mem.Allocator) !*sdl.SDL_Window {
        );
    }

    // Initialize SDL Hints
    {
        // SDL 2.0.22 introduced a new bug where SDL mouse autocapturing
        // causes touch-emulated mouse motion events to not appear.. disabling
        // mouse autocapturing resolves this.
        // See: https://github.com/libsdl-org/SDL/issues/5652
        _ = sdl.SDL_SetHint("SDL_MOUSE_AUTO_CAPTURE", "0");
    }

    // Initialize SDL video
    video_init: {
        // Attempt to initialize with whatever is set in SDL_VIDEODRIVER