From db21c67f1869eed13483c56ce0a42bfd9d982056 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 22 Mar 2019 13:03:34 +0100 Subject: [PATCH] Changed logic for releasing mouse capture into GLToolbar::on_mouse() --- src/slic3r/GUI/GLToolbar.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index ac79784ad..1b6570eab 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -411,24 +411,19 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent) // mouse anywhere if (evt.Moving()) + { m_tooltip = update_hover_state(mouse_pos, parent); + if ((m_mouse_capture.parent != nullptr) && (m_mouse_capture.parent != &parent)) + m_mouse_capture.reset(); + } else if (evt.LeftUp()) m_mouse_capture.left = false; else if (evt.MiddleUp()) m_mouse_capture.middle = false; else if (evt.RightUp()) m_mouse_capture.right = false; - else if (m_mouse_capture.any()) - { - if (evt.Dragging()) - processed = true; - else if (evt.Entering() && (m_mouse_capture.parent == &parent)) - // Resets the mouse capture state to avoid setting the dragging event as processed when, for example, - // the item action opens a modal dialog - // Keeps the mouse capture state if the entering event happens on different parent from the one - // who received the button down event, to prevent, for example, dragging when switching between scene views - m_mouse_capture.reset(); - } + else if (evt.Dragging() && m_mouse_capture.any()) + processed = true; int item_id = contains_mouse(mouse_pos, parent); if (item_id == -1)