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 --- next-steps.txt | 2 +- src/gui/gui.zig | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/next-steps.txt b/next-steps.txt index 63c355e9..0908b107 100644 --- a/next-steps.txt +++ b/next-steps.txt @@ -1,5 +1,5 @@ + Esc in normal mode toggles focus (the same functionality as spc+w+t). -- sdl backend no longer grabs mouse focus ++ sdl backend no longer grabs mouse focus - implement a real basic config file at ~/.config/pardes (use zig stdlib to locate these config dirs) which will execute the builtins in each line; like Font abc, Theme asdfd, this will execute before rendering so that the application won't flash or anything when styling changes. also if there's an error with a command, it will silently fail. - implement ipc comms via unix sockets, this will be used to deatach and reattach to a pardes session . - Add the New builtin that will open a new empty tempfile on the column that called it. 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