From 45d8bdccf0dcf72c56b81af3dd9e4c51b265ded4 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 13 Oct 2026 18:16:50 -0500 Subject: [PATCH] perf(startup): drop the unused SDL gamepad subsystem and nav flag Startup initialised SDL's gamepad subsystem and turned on ImGui gamepad navigation, but the wallet is never driven by a gamepad. Initialising the subsystem enumerates attached controllers and loads the mapping database for nothing. - SDL now starts with the video subsystem only. - ImGui keeps keyboard navigation; the gamepad navigation flag is removed from both the DX11 and the OpenGL setup paths. Co-Authored-By: Claude Opus 4.8 --- src/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 08abdd1..45a5eaf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2432,7 +2432,7 @@ static bool InitSDL() // sub-15 ms waits (vsync pacing, the 200 ms idle wait, >=50 ms thread sleeps), so let the system // timer relax. Ignored on non-Windows platforms; a false return (env override) is harmless. SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "0"); - if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD)) { + if (!SDL_Init(SDL_INIT_VIDEO)) { fprintf(stderr, "Error: SDL_Init(): %s\n", SDL_GetError()); return false; } @@ -2457,8 +2457,6 @@ static bool InitImGui(SDL_Window* window, dragonx::platform::DX11Context& dx) // Enable keyboard navigation io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; - // Enable gamepad navigation - io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable multi-viewport (windows can float outside main window) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; @@ -2519,8 +2517,6 @@ static bool InitImGui(SDL_Window* window, SDL_GLContext gl_context) // Enable keyboard navigation io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; - // Enable gamepad navigation - io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable multi-viewport (windows can float outside main window) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;