From 4f980de2c7a2ec29c561bca815c37879a18cc2b3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 2 Aug 2026 18:13:58 -0300 Subject: SDL backend does not grab mouse focus --- src/gui/gui.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index ef2422c5..7d2a8cf1 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1012,9 +1012,10 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options) !void { if (c.SDL_CreateCursor(&p9_arrow_set, &p9_arrow_mask, 16, 16, 1, 1)) |cur| { _ = c.SDL_SetCursor(cur); } else log.err("SDL_CreateCursor: {s}", .{c.SDL_GetError()}); - // fullscreen deck use: keep the pointer inside the window. Absolute - // coords stay (no relative mode — clicks need positions). - if (!test_mode) _ = c.SDL_SetWindowMouseGrab(window, true); + // Keep the window's mouse ungrabbed: desktop users must be able to move + // the pointer out normally. The deck's virtual pointer is clamped and + // warped explicitly only when its controls move it (see dispatch and + // pollGamepad), so it does not need window-wide confinement. const device = c.SDL_CreateGPUDevice(c.SDL_GPU_SHADERFORMAT_SPIRV, true, null) orelse { log.err("SDL_CreateGPUDevice: {s}", .{c.SDL_GetError()}); return error.SdlInit; -- cgit v1.3