diff --git a/src/guiengine/abstract_state_manager.cpp b/src/guiengine/abstract_state_manager.cpp index 6ca9d52aa..b0b7a38bb 100644 --- a/src/guiengine/abstract_state_manager.cpp +++ b/src/guiengine/abstract_state_manager.cpp @@ -21,6 +21,7 @@ #include "config/user_config.hpp" #include "guiengine/engine.hpp" #include "guiengine/modaldialog.hpp" +#include "guiengine/screen_keyboard.hpp" #include "guiengine/screen.hpp" #include "input/device_manager.hpp" @@ -49,6 +50,7 @@ void AbstractStateManager::enterGameState() { // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); if (getCurrentScreen() != NULL) getCurrentScreen()->tearDown(); m_menu_stack.clear(); @@ -90,6 +92,7 @@ void AbstractStateManager::pushMenu(Screen* screen) // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); if (UserConfigParams::logGUI()) { @@ -122,6 +125,7 @@ void AbstractStateManager::pushScreen(Screen* screen) { // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); if (UserConfigParams::logGUI()) { @@ -146,6 +150,7 @@ void AbstractStateManager::replaceTopMostScreen(Screen* screen, GUIEngine::GameS //assert(m_game_mode != GAME); // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); if (!screen->isLoaded()) screen->loadFromFile(); std::string name = screen->getName(); @@ -179,6 +184,7 @@ void AbstractStateManager::reshowTopMostMenu() assert(m_game_mode != GAME); // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); // Send tear-down event to previous menu if (m_menu_stack.size() > 0) @@ -243,6 +249,7 @@ void AbstractStateManager::resetAndGoToScreen(Screen* screen) { // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); std::string name = screen->getName(); @@ -271,6 +278,7 @@ void AbstractStateManager::resetAndSetStack(Screen* screens[]) assert(screens[0] != NULL); // you need to close any dialog before calling this assert(!ModalDialog::isADialogActive()); + assert(!ScreenKeyboard::isActive()); if (m_game_mode != GAME) getCurrentScreen()->tearDown(); m_menu_stack.clear(); diff --git a/src/network/protocols/client_lobby.cpp b/src/network/protocols/client_lobby.cpp index 36a13678e..e00e72447 100644 --- a/src/network/protocols/client_lobby.cpp +++ b/src/network/protocols/client_lobby.cpp @@ -218,6 +218,10 @@ bool ClientLobby::notifyEventAsynchronous(Event* event) //----------------------------------------------------------------------------- void ClientLobby::addAllPlayers(Event* event) { + // In case the user opened a user info dialog + GUIEngine::ModalDialog::dismiss(); + GUIEngine::ScreenKeyboard::dismiss(); + if (!checkDataSize(event, 1)) { // If recieved invalid message for players leave now @@ -364,6 +368,7 @@ void ClientLobby::update(int ticks) m_received_server_result = true; // In case someone opened paused race dialog or menu in network game GUIEngine::ModalDialog::dismiss(); + GUIEngine::ScreenKeyboard::dismiss(); if (StateManager::get()->getGameState() == GUIEngine::INGAME_MENU) StateManager::get()->enterGameState(); World::getWorld()->enterRaceOverState(); @@ -904,6 +909,10 @@ void ClientLobby::raceFinished(Event* event) */ void ClientLobby::exitResultScreen(Event *event) { + // In case the user opened a user info dialog + GUIEngine::ModalDialog::dismiss(); + GUIEngine::ScreenKeyboard::dismiss(); + setup(); m_state.store(CONNECTED); RaceResultGUI::getInstance()->backToLobby();