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.
This commit is contained in:
SoftFever 2025-08-11 23:49:06 +08:00 committed by GitHub
parent 05adf5f9c9
commit eb92a2ddde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);