Skip to content

Commit

Permalink
Fix windows unminimizing on windows (fix #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Feb 11, 2019
1 parent fd7ef8d commit d5c3ef8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/ui/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,16 +788,15 @@ void MainWindow::loadFileNonInteractive( const QString& file_name )
#ifdef Q_OS_WIN
const auto isMaximized = isMaximized_;

for ( QWindow* appWindow : QGuiApplication::allWindows() ) {
appWindow->show();
appWindow->raise();
appWindow->requestActivate();
}

if ( isMaximized ) {
QTimer::singleShot(50, [this] { setWindowState( windowState() | Qt::WindowMaximized ); } );
showMaximized();
}
else {
showNormal();
}

activateWindow();
raise();
#else
Qt::WindowFlags window_flags = windowFlags();
window_flags |= Qt::WindowStaysOnTopHint;
Expand Down

0 comments on commit d5c3ef8

Please sign in to comment.