summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.cpp
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-07-16 08:53:08 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 21:54:11 +0100
commitd33ed5923ab5336005257203d21ddcb3d37d0ff8 (patch)
tree5eefe32329abd94851a71f5b591bcbc3cad464b7 /src/gui/widgets/window.cpp
parent135ed667ef82eaf348ce043a9864a6e7864ebad3 (diff)
downloadmana-d33ed5923ab5336005257203d21ddcb3d37d0ff8.tar.gz
mana-d33ed5923ab5336005257203d21ddcb3d37d0ff8.tar.bz2
mana-d33ed5923ab5336005257203d21ddcb3d37d0ff8.tar.xz
mana-d33ed5923ab5336005257203d21ddcb3d37d0ff8.zip
Remove focus from a window's internal widgets on hiding.
Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index d4ecf75d..59ec8939 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -35,6 +35,7 @@
#include "resources/image.h"
#include <guichan/exception.hpp>
+#include <guichan/focushandler.hpp>
int Window::instances = 0;
int Window::mouseResize = 0;
@@ -285,6 +286,14 @@ void Window::widgetHidden(const gcn::Event &event)
{
gui->setCursorType(Gui::CURSOR_POINTER);
}
+
+ WidgetListIterator it;
+
+ for (it = mWidgets.begin(); it != mWidgets.end(); it++)
+ {
+ if (mFocusHandler->isFocused(*it))
+ mFocusHandler->focusNone();
+ }
}
void Window::setCloseButton(bool flag)