Fix mouse events sent to wrong GUI elements when dragging
authorsfan5 <sfan5@live.de>
Sun, 15 Mar 2020 19:34:49 +0000 (20:34 +0100)
committersfan5 <sfan5@live.de>
Mon, 16 Mar 2020 21:57:10 +0000 (22:57 +0100)
src/gui/guiFormSpecMenu.cpp

index 9f20877a9a3d6cace94732f7f4377dcd2653c74f..012ac953f822c9973fd62b07e0a846dc3482dbf5 100644 (file)
@@ -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 =