summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/window.cpp9
-rw-r--r--src/gui/widgets/window.h2
2 files changed, 10 insertions, 1 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)
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 37a6b1eb..5df431a3 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -105,7 +105,7 @@ class Window : public gcn::Window, gcn::WidgetListener
/**
* Called whenever the widget is hidden.
*/
- void widgetHidden(const gcn::Event &event);
+ virtual void widgetHidden(const gcn::Event& event);
/**
* Sets whether or not the window has a close button.