summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-19 00:30:19 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-19 00:30:19 +0200
commitb9331fca5a0472890c388175f23c6c7f70ab8d7f (patch)
treeded661080cbadb2005c9c98d157e83f91d8cc615 /src/gui/gui.cpp
parent0b10f0318b9f9ab308f04712698aa104bec21e29 (diff)
downloadplus-b9331fca5a0472890c388175f23c6c7f70ab8d7f.tar.gz
plus-b9331fca5a0472890c388175f23c6c7f70ab8d7f.tar.bz2
plus-b9331fca5a0472890c388175f23c6c7f70ab8d7f.tar.xz
plus-b9331fca5a0472890c388175f23c6c7f70ab8d7f.zip
Fix race condition in guichan bugfix.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 984b9ea1a..937a102f7 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -27,6 +27,7 @@
#include "gui/theme.h"
#include "gui/truetypefont.h"
+#include "gui/widgets/mouseevent.h"
#include "gui/widgets/window.h"
#include "gui/widgets/windowcontainer.h"
@@ -331,6 +332,10 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,
return;
}
+ MouseEvent mouseEvent(source, mShiftPressed, mControlPressed,
+ mAltPressed, mMetaPressed, type, button,
+ x, y, mClickCount);
+
while (parent != NULL)
{
// If the widget has been removed due to input
@@ -340,14 +345,14 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,
parent = (gcn::Widget*)widget->getParent();
+
if (widget->isEnabled() || force)
{
int widgetX, widgetY;
widget->getAbsolutePosition(widgetX, widgetY);
- gcn::MouseEvent mouseEvent(source, mShiftPressed, mControlPressed,
- mAltPressed, mMetaPressed, type, button,
- x - widgetX, y - widgetY, mClickCount);
+ mouseEvent.setX(x - widgetX);
+ mouseEvent.setY(y - widgetY);
std::list<gcn::MouseListener*> mouseListeners
= widget->_getMouseListeners();