From 494d50bd55dd30f9bfeda2125bae6bdc3fb6e5a0 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Mon, 7 Sep 2026 01:16:45 -0500 Subject: [PATCH] fix: restore Ctrl+drag panning on macOS (#15312) On macOS wxWidgets reports Ctrl+left as a synthetic right button, which is what made Ctrl+drag pan the canvas. #14999 added an unconditional correction of the event's button state from wxGetMouseState(), which reports the physical buttons and knows nothing about that synthesis, so the synthetic right button was overwritten with a plain left button on every event. Ctrl+drag then matched the left button mapping and rotated instead of panning. Apply the correction only when the event carries no button state at all. On macOS wx populates button state only for the mouse-down and mouse-dragged event types, which are also the only ones the Ctrl+left translation touches, so the ImGui capture fix keeps every event it was added for. Fixes #15214 Co-authored-by: Noisyfox --- src/slic3r/GUI/GLCanvas3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7db7e01e9c..6cdc27ed65 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4168,7 +4168,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // https://github.com/OrcaSlicer/OrcaSlicer/pull/14999#issuecomment-5151344759 // We solve this by correcting the state of the event from the actual mouse state querying with `wxGetMouseState()` // so it works like on other platforms. - { + // Only fill in state the event does not carry, to preserve wx's synthetic right button for Ctrl+left. + if (!evt.ButtonIsDown(wxMOUSE_BTN_ANY)) { const auto state = wxGetMouseState(); evt.SetLeftDown(state.LeftIsDown()); evt.SetMiddleDown(state.MiddleIsDown());