summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
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();