aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-03-15 20:34:49 +0100
committersfan5 <sfan5@live.de>2020-03-16 22:57:10 +0100
commit5a31d56c9f9546838b602d0226e341dd30030edf (patch)
treeff90b647c814e392d03860c2b88b460e02b82761
parent13ad8e2a090eec97f31a1c62e2052a51dcff4434 (diff)
downloadminetest-5a31d56c9f9546838b602d0226e341dd30030edf.tar.gz
minetest-5a31d56c9f9546838b602d0226e341dd30030edf.tar.bz2
minetest-5a31d56c9f9546838b602d0226e341dd30030edf.zip
Fix mouse events sent to wrong GUI elements when dragging
-rw-r--r--src/gui/guiFormSpecMenu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 9f20877a9..012ac953f 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -3661,7 +3661,8 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
// Mouse wheel and move events: send to hovered element instead of focused
if (event.EventType == EET_MOUSE_INPUT_EVENT &&
(event.MouseInput.Event == EMIE_MOUSE_WHEEL ||
- event.MouseInput.Event == EMIE_MOUSE_MOVED)) {
+ (event.MouseInput.Event == EMIE_MOUSE_MOVED &&
+ event.MouseInput.ButtonStates == 0))) {
s32 x = event.MouseInput.X;
s32 y = event.MouseInput.Y;
gui::IGUIElement *hovered =