From c0533eba6f7c85e32afaf7767e9f8080d001eb21 Mon Sep 17 00:00:00 2001 From: Dima Buzdyk <46728448+buzzhuzz@users.noreply.github.com> Date: Sat, 1 Feb 2025 16:02:10 +0600 Subject: [PATCH] Fix sticky camera rotate for touchpad navigation style on Windows (#8249) * glcanvas: add modifiers to mouse events logging * glcanvas: workaround for touchpad nav on Win Releasing ALT on windows platform result in GLCanvas losing focus. Because of this mouse movements not being processed by on_mouse() event handler and camera rotation have not cleaned up. Make a workaround for Windows to cleanup camera rotate state on releasing ALT modifier. --- src/slic3r/GUI/GLCanvas3D.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 9a3829f18b..abcba5d402 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3519,6 +3519,12 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) m_dirty = true; } // set_cursor(Standard); +#ifdef __WXMSW__ + if (m_camera_movement && m_is_touchpad_navigation) { + m_camera_movement = false; + m_mouse.set_start_position_3D_as_invalid(); + } +#endif } else if (keyCode == WXK_CONTROL) m_dirty = true; @@ -3873,6 +3879,12 @@ std::string format_mouse_event_debug_message(const wxMouseEvent &evt) out += "RightUp "; if (evt.RightDClick()) out += "RightDClick "; + if (evt.AltDown()) + out += "AltDown "; + if (evt.ShiftDown()) + out += "ShiftDown "; + if (evt.ControlDown()) + out += "ControlDown "; sprintf(buf, "(%d, %d)", evt.GetX(), evt.GetY()); out += buf;