diff options
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 47615adfe..940f24dc8 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -984,7 +984,7 @@ void GMainWindow::BootGame(const QString& filename) { return; // Create and start the emulation thread - emu_thread = std::make_unique<EmuThread>(*render_window); + emu_thread = std::make_unique<EmuThread>(); emit EmulationStarting(emu_thread.get()); emu_thread->start(); @@ -1034,6 +1034,14 @@ void GMainWindow::BootGame(const QString& filename) { } void GMainWindow::ShutdownGame() { + if (!emulation_running) { + return; + } + + if (ui.action_Fullscreen->isChecked()) { + HideFullscreen(); + } + AllowOSSleep(); discord_rpc->Pause(); @@ -1716,11 +1724,6 @@ void GMainWindow::OnStartGame() { } void GMainWindow::OnPauseGame() { - Core::System& system{Core::System::GetInstance()}; - if (system.GetExitLock() && !ConfirmForceLockedExit()) { - return; - } - emu_thread->SetRunning(false); ui.action_Start->setEnabled(true); @@ -1803,7 +1806,7 @@ void GMainWindow::ToggleWindowMode() { // Render in the main window... render_window->BackupGeometry(); ui.horizontalLayout->addWidget(render_window); - render_window->setFocusPolicy(Qt::ClickFocus); + render_window->setFocusPolicy(Qt::StrongFocus); if (emulation_running) { render_window->setVisible(true); render_window->setFocus(); @@ -2375,7 +2378,6 @@ int main(int argc, char* argv[]) { // Enables the core to make the qt created contexts current on std::threads QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); - QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication app(argc, argv); // Qt changes the locale and causes issues in float conversion using std::to_string() when |