Skip to content

Commit

Permalink
Qt: Fix render widget not being on top when using -n / -e
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed May 13, 2018
1 parent 99dff10 commit fa77e09
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt2/Main.cpp
Expand Up @@ -180,7 +180,7 @@ int main(int argc, char* argv[])
MainWindow win{std::move(boot)};
if (options.is_set("debugger"))
Settings::Instance().SetDebugModeEnabled(true);
win.show();
win.Show();

#if defined(USE_ANALYTICS) && USE_ANALYTICS
if (!SConfig::GetInstance().m_analytics_permission_asked)
Expand Down
14 changes: 13 additions & 1 deletion Source/Core/DolphinQt2/MainWindow.cpp
Expand Up @@ -110,7 +110,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
NetPlayInit();

if (boot_parameters)
StartGame(std::move(boot_parameters));
m_pending_boot = std::move(boot_parameters);

QSettings& settings = Settings::GetQSettings();

Expand Down Expand Up @@ -1351,3 +1351,15 @@ void MainWindow::OnUpdateProgressDialog(QString title, int progress, int total)
m_progress_dialog = nullptr;
}
}

void MainWindow::Show()
{
QWidget::show();

// If the booting of a game was requested on start up, do that now
if (m_pending_boot != nullptr)
{
StartGame(std::move(m_pending_boot));
m_pending_boot.reset();
}
}
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt2/MainWindow.h
Expand Up @@ -58,6 +58,8 @@ class MainWindow final : public QMainWindow
explicit MainWindow(std::unique_ptr<BootParameters> boot_parameters);
~MainWindow();

void Show();

bool eventFilter(QObject* object, QEvent* event) override;

signals:
Expand Down

0 comments on commit fa77e09

Please sign in to comment.