diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-02 18:13:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 4f980de2c7a2ec29c561bca815c37879a18cc2b3 (patch) | |
| tree | 904f0c295c4b7a29fae835c9a1500e35d885549e /src/gui | |
| parent | 4ffc8ed795ff58426aea28d3b3b38df1428d2980 (diff) | |
| download | pardes-4f980de2c7a2ec29c561bca815c37879a18cc2b3.tar.gz pardes-4f980de2c7a2ec29c561bca815c37879a18cc2b3.zip | |
SDL backend does not grab mouse focus
Diffstat (limited to 'src/gui')
| -rw-r--r-- | src/gui/gui.zig | 7 |
1 files changed, 4 insertions, 3 deletions
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; |
