Ref T747, combine "on top" with window to front

This commit is contained in:
Klaus Basan
2019-11-03 21:22:55 +01:00
committed by Mat Sutcliffe
parent 336ad1c160
commit 109827b5c4
2 changed files with 19 additions and 5 deletions

View File

@@ -1177,20 +1177,33 @@ namespace BlackGui
if (this->isShuttingDown()) { return; }
QMainWindow *w = sGui->mainApplicationWindow();
if (!w) { return; }
m_frontBack = true;
w->showNormal(); // bring window to top on OSX
w->raise(); // bring window from minimized state on OSX
w->activateWindow(); // bring window to front/unminimize on windows
// In order to show also on top if another window is (permanent) on top
if (!CGuiUtility::staysOnTop(w))
{
CGuiUtility::stayOnTop(true, w);
emit this->alwaysOnTop(true);
}
// w->activateWindow(); // bring window to front/unminimize on windows
}
void CGuiApplication::windowToBack()
{
if (this->isShuttingDown()) { return; }
m_frontBack = false;
QMainWindow *w = this->mainApplicationWindow();
if (!w) { return; }
if (CGuiUtility::staysOnTop(w)) { CGuiUtility::stayOnTop(false, w); }
m_frontBack = false;
if (CGuiUtility::staysOnTop(w))
{
CGuiUtility::stayOnTop(false, w);
emit this->alwaysOnTop(false);
}
w->lower();
}