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();