From 39baf6d917e8b2aee4127fb72b8024e58d0dff0f Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Wed, 25 Nov 2026 02:02:41 +0800 Subject: [PATCH] Finish touchpad camera panning when Shift is released (#17846) In Touchpad camera mode, releasing Shift after a pan or Alt after an orbit left the camera move active. The next right-click then skipped the menu and, since #17432, the object selection. Finish the pan on Shift release and the orbit on Alt release. This replaces the Windows-only Alt release handling from #8249, which stopped the orbit but still left the next right-click ignored. Fixes #17844 --- src/slic3r/GUI/GLCanvas3D.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 462495f7b9..4348933a63 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5096,6 +5096,8 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) m_mouse.ignore_left_up = true; m_dirty = true; } + else if (m_is_touchpad_navigation && m_mouse.drag.camera_pan_anchor.has_value()) + mouse_up_cleanup(); // set_cursor(Standard); } else if (keyCode == WXK_ALT) { @@ -5105,13 +5107,11 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) m_mouse.ignore_left_up = true; m_dirty = true; } + // Orbit stores its last pointer position in the 3D slot. A pan or a new button press sets the 2D slot. + else if (m_is_touchpad_navigation && m_camera_movement && m_mouse.is_start_position_3D_defined() && + !m_mouse.is_start_position_2D_defined()) + mouse_up_cleanup(); // 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;