Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-02-22 18:16:04 +0300
committerbubnikv <bubnikv@gmail.com>2019-02-22 18:16:04 +0300
commit7b65803cb377b61062475efe20bb6b2ccb4e2f4e (patch)
tree831172975ff5c90f8a963f381df26d992b46ae7a /src
parented5598f59fea7afd5df5d2245ab8a597a1914d92 (diff)
Fix of SPE-832
Workaround for a wxWidget bug, where the mouse down event comes before mouse enter event after a pop-up menu is closed.
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/GLCanvas3D.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index d48b6ea61..c6d465ad2 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -4755,15 +4755,22 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
evt.SetY(evt.GetY() * scale);
#endif
+ Point pos(evt.GetX(), evt.GetY());
+
#if ENABLE_IMGUI
- auto imgui = wxGetApp().imgui();
+ ImGuiWrapper *imgui = wxGetApp().imgui();
if (imgui->update_mouse_data(evt)) {
+ m_mouse.position = evt.Leaving() ? Vec2d(-1.0, -1.0) : pos.cast<double>();
render();
return;
}
#endif // ENABLE_IMGUI
- Point pos(evt.GetX(), evt.GetY());
+ if (! evt.Entering() && ! evt.Leaving() && m_mouse.position.x() == -1.0) {
+ // Workaround for SPE-832: There seems to be a mouse event sent to the window before evt.Entering()
+ m_mouse.position = pos.cast<double>();
+ render();
+ }
if (m_picking_enabled)
_set_current();