FIX: speed switch popup window display bug

Jira: [STUDIO-14642]
Change-Id: If95ca1b448b2d3a03c2f6d6c0b5faad4a3c04e8c
(cherry picked from commit 08943207564c0256d5a5efea9440e55efb7ccea0)
This commit is contained in:
hemai
2025-10-28 15:29:54 +08:00
committed by Noisyfox
parent ada573a1fd
commit 32af91cf61
3 changed files with 48 additions and 3 deletions
+34
View File
@@ -31,6 +31,11 @@ PopupWindow::~PopupWindow()
#ifdef __WXGTK__
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
#endif
#ifdef __WXMSW__
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActivate, this);
GetTopParent(this)->Unbind(wxEVT_ICONIZE, &PopupWindow::topWindowIconize, this);
GetTopParent(this)->Unbind(wxEVT_SHOW, &PopupWindow::topWindowShow, this);
#endif
}
#ifdef __WXOSX__
@@ -84,3 +89,32 @@ void PopupWindow::topWindowActiavate(wxActivateEvent &event)
if (!event.GetActive() && IsShown()) DismissAndNotify();
}
#endif
#ifdef __WXMSW__
void PopupWindow::BindUnfocusEvent()
{
GetTopParent(this)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActivate, this);
GetTopParent(this)->Bind(wxEVT_ICONIZE, &PopupWindow::topWindowIconize, this);
GetTopParent(this)->Bind(wxEVT_SHOW, &PopupWindow::topWindowShow, this);
}
void PopupWindow::topWindowActivate(wxActivateEvent &event)
{
if (!event.GetActive())
Dismiss();
}
void PopupWindow::topWindowIconize(wxIconizeEvent &event)
{
event.Skip();
if (event.IsIconized())
Dismiss();
}
void PopupWindow::topWindowShow(wxShowEvent &event)
{
event.Skip();
if (!event.IsShown())
Dismiss();
}
#endif