Skip to content

Commit

Permalink
InputManager: fix screen flash when active controller changed
Browse files Browse the repository at this point in the history
not sure why Selectable caused screen flash, button seems to work fine
  • Loading branch information
emoose committed Jan 10, 2025
1 parent 924c206 commit cde0fb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/input_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,17 +870,16 @@ 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);
}

ImGui::TableNextColumn();

if (isPrimary)
if (int(i) == primaryControllerIndex)
ImGui::Text("Active/Primary");
else
ImGui::Text("Inactive");
Expand Down

0 comments on commit cde0fb4

Please sign in to comment.