mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-26 16:13:58 -06:00
FIX: [STUDIO-2186] hide PopupWindow on alt-tab
Change-Id: Ie1bffdd9ace2c6e05979743da9f75ca2c1e87cf3
This commit is contained in:
parent
6faecbf718
commit
81dea77932
23 changed files with 139 additions and 70 deletions
33
src/slic3r/GUI/Widgets/PopupWindow.cpp
Normal file
33
src/slic3r/GUI/Widgets/PopupWindow.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "PopupWindow.hpp"
|
||||
|
||||
static wxWindow *GetTopParent(wxWindow *pWindow)
|
||||
{
|
||||
wxWindow *pWin = pWindow;
|
||||
while (pWin->GetParent()) pWin = pWin->GetParent();
|
||||
return pWin;
|
||||
}
|
||||
|
||||
bool PopupWindow::Create(wxWindow *parent, int style)
|
||||
{
|
||||
if (!wxPopupTransientWindow::Create(parent, style))
|
||||
return false;
|
||||
#ifdef __WXGTK__
|
||||
GetTopParent(parent)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
PopupWindow::~PopupWindow()
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __WXGTK__
|
||||
void PopupWindow::topWindowActiavate(wxActivateEvent &event)
|
||||
{
|
||||
event.Skip();
|
||||
if (!event.GetActive() && IsShown()) DismissAndNotify();
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue