From 866877cad03798935021f2dbd3d659799b8dbddc Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 7 Feb 2026 19:08:16 -0800 Subject: [PATCH] Refine chat input focus behavior --- src/ui/game_screen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 4fd01cc5..538fad28 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -402,11 +402,6 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { chatWindowPos_ = ImGui::GetWindowPos(); } - // Click anywhere in chat window → focus the input field - if (ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && ImGui::IsMouseClicked(0)) { - refocusChatInput = true; - } - // Chat history const auto& chatHistory = gameHandler.getChatHistory(); @@ -440,6 +435,11 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { ImGui::EndChild(); + // Click on chat history area → focus the input field + if (ImGui::IsItemClicked()) { + refocusChatInput = true; + } + ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing();