From d2473f3b22fa2d58a405a9f663028ca1b279d216 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Thu, 8 Oct 2026 15:37:32 +0800 Subject: [PATCH] Dismiss the Slice-Plate Popup Before the Filament Grouping Dialog Opens The Slice-plate hover popup (FilamentGroupPopup, a wxPopupTransientWindow) takes the mouse capture while it is shown, and on macOS its OnIdle handler reacquires that capture whenever the cursor sits outside the popup. If the popup is still shown when the modal filament grouping dialog opens, wx routes every dialog mouse event to the now-hidden popup, because WX_filterSendEvent short-circuits to the capture window while GetCapture() is non-null. The dialog's filament blocks never receive a mouse-down, so they can't be dragged and the whole app looks frozen even though its modal loop is healthy and the keyboard still works. Dismiss the popup synchronously before the dialog opens: Dismiss() hides it and releases the capture, and hiding it stops OnIdle from reacquiring. This is a no-op where the popup is never shown (Linux, where the hover popup is disabled, and any non-dual-nozzle printer). --- src/slic3r/GUI/FilamentGroupPopup.hpp | 2 +- src/slic3r/GUI/MainFrame.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/FilamentGroupPopup.hpp b/src/slic3r/GUI/FilamentGroupPopup.hpp index 09b6b8d344..e50c04317f 100644 --- a/src/slic3r/GUI/FilamentGroupPopup.hpp +++ b/src/slic3r/GUI/FilamentGroupPopup.hpp @@ -29,6 +29,7 @@ public: FilamentGroupPopup(wxWindow *parent); void tryPopup(Plater* plater,PartPlate* plate, bool slice_all); void tryClose(); + void Dismiss() override; FilamentMapMode GetSelectedMode() const { return m_mode; } private: @@ -40,7 +41,6 @@ private: void OnLeaveWindow(wxMouseEvent &); void OnEnterWindow(wxMouseEvent &); void OnTimer(wxTimerEvent &event); - void Dismiss(); void CreateBmps(); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 84b702d7e5..bb5ffc87de 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -2309,6 +2309,12 @@ wxBoxSizer* MainFrame::create_side_tools() bool slice = true; + // The Slice-plate hover popup is a transient popup that keeps grabbing + // the mouse capture while shown. Left behind the modal grouping dialog it + // would starve that dialog of mouse events, so close it synchronously first. + if (m_filament_group_popup) + m_filament_group_popup->Dismiss(); + auto curr_plate = m_plater->get_partplate_list().get_curr_plate(); #ifdef __linux__ PresetBundle* preset = wxGetApp().preset_bundle;