diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-10 12:06:16 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-10 12:06:16 +0200 |
commit | 1931eb352bd6db3e12285d7fde1e1be886fefa11 (patch) | |
tree | 21152b55fa4fe2cd7f106e5102eaaac11bad3755 /src | |
parent | b74add61aa176df9f3661d6a9c710abe05cc8f11 (diff) | |
download | mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.gz mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.bz2 mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.xz mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.zip |
Don't show the chat input when a modal widget has focus
For example, the chat input would become visible when using Enter to
confirm the exit dialog.
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 8 | ||||
-rw-r--r-- | src/gui/gui.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp index 203629ff..d3ca2e7c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -87,6 +87,7 @@ #include "utils/gettext.h" #include <guichan/exception.hpp> +#include <guichan/focushandler.hpp> #include <fstream> #include <physfs.h> @@ -544,11 +545,13 @@ void Game::handleInput() } } - if (!(chatWindow->isInputFocused() || deathNotice || weightNotice)) + if (!chatWindow->isInputFocused() + && !gui->getFocusHandler()->getModalFocused()) + { if (keyboard.isKeyActive(keyboard.KEY_OK)) { #ifdef TMWSERV_SUPPORT - // Don not focus chat input when quit dialog is active + // Do not focus chat input when quit dialog is active if (quitDialog != NULL && quitDialog->isVisible()) continue; #else @@ -579,6 +582,7 @@ void Game::handleInput() if (chatWindow->requestChatFocus()) used = true; } + } if (!chatWindow->isInputFocused() || (event.key.keysym.mod & KMOD_ALT)) diff --git a/src/gui/gui.h b/src/gui/gui.h index e4e83468..c7b9bbfa 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -70,6 +70,9 @@ class Gui : public gcn::Gui */ void draw(); + gcn::FocusHandler *getFocusHandler() const + { return mFocusHandler; } + /** * Return game font. */ |