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.
This commit is contained in:
parent
ed5598f59f
commit
7b65803cb3
1 changed files with 9 additions and 2 deletions
|
@ -4755,15 +4755,22 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
evt.SetY(evt.GetY() * scale);
|
evt.SetY(evt.GetY() * scale);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Point pos(evt.GetX(), evt.GetY());
|
||||||
|
|
||||||
#if ENABLE_IMGUI
|
#if ENABLE_IMGUI
|
||||||
auto imgui = wxGetApp().imgui();
|
ImGuiWrapper *imgui = wxGetApp().imgui();
|
||||||
if (imgui->update_mouse_data(evt)) {
|
if (imgui->update_mouse_data(evt)) {
|
||||||
|
m_mouse.position = evt.Leaving() ? Vec2d(-1.0, -1.0) : pos.cast<double>();
|
||||||
render();
|
render();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // ENABLE_IMGUI
|
#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)
|
if (m_picking_enabled)
|
||||||
_set_current();
|
_set_current();
|
||||||
|
|
Loading…
Reference in a new issue