From 797ee70b0bb5548a0dcc7b403585fa24197aa5e3 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 12 May 2026 00:44:14 +0800 Subject: [PATCH] fixed an issue that FilamentGroupPopup dialog didn't dismiss on macOS (#13574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS, PopupWindow::OnMouseEvent2 synthesizes a wxEVT_ENTER_WINDOW on `this` whenever the hovered target transitions from a child back to the popup itself. wxPopupTransientWindow's OnIdle re-acquires mouse capture once the cursor leaves the popup, so the next MOTION (with the cursor already outside) hits OnMouseEvent2 with no child and synthesizes ENTER on the popup — which would otherwise cancel the dismissal timer started by OnLeaveWindow. Verify the cursor is actually inside before resetting. --- src/slic3r/GUI/FilamentGroupPopup.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/FilamentGroupPopup.cpp b/src/slic3r/GUI/FilamentGroupPopup.cpp index 799ded38fd..2cff9c3c82 100644 --- a/src/slic3r/GUI/FilamentGroupPopup.cpp +++ b/src/slic3r/GUI/FilamentGroupPopup.cpp @@ -353,7 +353,13 @@ void FilamentGroupPopup::OnLeaveWindow(wxMouseEvent &) StartTimer(); } -void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &) { ResetTimer(); } +void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &) +{ + // Ignore spurious ENTER synthesized by PopupWindow::OnMouseEvent2 on macOS. + wxPoint pos = this->ScreenToClient(wxGetMousePosition()); + if (!this->GetClientRect().Contains(pos)) return; + ResetTimer(); +} void FilamentGroupPopup::UpdateButtonStatus(int hover_idx) {