From cde0fb45b9f63776971d14043bbd277819f7788f Mon Sep 17 00:00:00 2001 From: emoose Date: Fri, 10 Jan 2025 17:01:34 +0000 Subject: [PATCH] InputManager: fix screen flash when active controller changed not sure why Selectable caused screen flash, button seems to work fine --- src/input_manager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/input_manager.cpp b/src/input_manager.cpp index 050840b..5fbf3e3 100644 --- a/src/input_manager.cpp +++ b/src/input_manager.cpp @@ -870,9 +870,8 @@ class InputManager auto* controller = controllers[i]; std::string name = SDL_GetGamepadName(controller); - bool isPrimary = (int)i == primaryControllerIndex; - if (ImGui::Selectable(name.c_str(), isPrimary)) + if(ImGui::Button(name.c_str())) { primaryControllerIndex = i; setupGamepad(controller); @@ -880,7 +879,7 @@ class InputManager ImGui::TableNextColumn(); - if (isPrimary) + if (int(i) == primaryControllerIndex) ImGui::Text("Active/Primary"); else ImGui::Text("Inactive");