From eb92a2dddea1e4064d2f0a0205c5381e1952b6b4 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 11 Aug 2025 23:49:06 +0800 Subject: [PATCH] Fix focus stealing issue in dialog windows (#9874) (#10374) Remove RequestUserAttention calls on window deactivation to prevent random window activation when multiple OrcaSlicer instances are running. --- src/slic3r/GUI/ReleaseNote.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 0d5dcc467d..aee349cd61 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -698,7 +698,9 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons m_sizer_main->Add(m_sizer_right, 0, wxBOTTOM | wxEXPAND, FromDIP(5)); Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->on_hide();}); - Bind(wxEVT_ACTIVATE, [this](auto& e) { if (!e.GetActive()) this->RequestUserAttention(wxUSER_ATTENTION_ERROR); }); + // Fix for #9874: Remove RequestUserAttention on deactivation to prevent focus stealing + // This was causing random window activation when multiple instances were running + // Bind(wxEVT_ACTIVATE, [this](auto& e) { if (!e.GetActive()) this->RequestUserAttention(wxUSER_ATTENTION_ERROR); }); SetSizer(m_sizer_main); Layout(); @@ -891,7 +893,9 @@ PrintErrorDialog::PrintErrorDialog(wxWindow* parent, wxWindowID id, const wxStri m_sizer_main->Add(m_sizer_right, 0, wxBOTTOM | wxEXPAND, FromDIP(5)); Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->on_hide(); }); - Bind(wxEVT_ACTIVATE, [this](auto& e) { if (!e.GetActive()) this->RequestUserAttention(wxUSER_ATTENTION_ERROR); }); + // Fix for #9874: Remove RequestUserAttention on deactivation to prevent focus stealing + // This was causing random window activation when multiple instances were running + // Bind(wxEVT_ACTIVATE, [this](auto& e) { if (!e.GetActive()) this->RequestUserAttention(wxUSER_ATTENTION_ERROR); }); Bind(wxEVT_WEBREQUEST_STATE, &PrintErrorDialog::on_webrequest_state, this);