summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-12-24 03:03:58 +0100
committerGitHub <noreply@github.com>2022-12-24 03:03:58 +0100
commitfa231645f276c80c34f3b439bd2f60b3d743a789 (patch)
treee146caff183640809e7707b0b53e9614a8dc6f9a
parentMerge pull request #9463 from liamwhite/manager-events (diff)
parentqt: exit properly on guest-initiated close (diff)
downloadyuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar.gz
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar.bz2
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar.lz
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar.xz
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.tar.zst
yuzu-fa231645f276c80c34f3b439bd2f60b3d743a789.zip
-rw-r--r--src/yuzu/bootmanager.cpp1
-rw-r--r--src/yuzu/main.cpp9
2 files changed, 9 insertions, 1 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 13782869d..3d560f303 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -78,7 +78,6 @@ void EmuThread::run() {
gpu.Start();
m_system.GetCpuManager().OnGpuReady();
- m_system.RegisterExitCallback([this] { m_stop_source.request_stop(); });
if (m_system.DebuggerEnabled()) {
m_system.InitializeDebugger();
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 820f60e61..7ec613669 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1710,6 +1710,11 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
system->RegisterExecuteProgramCallback(
[this](std::size_t program_index_) { render_window->ExecuteProgram(program_index_); });
+ system->RegisterExitCallback([this] {
+ emu_thread->ForceStop();
+ render_window->Exit();
+ });
+
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
connect(render_window, &GRenderWindow::MouseActivity, this, &GMainWindow::OnMouseActivity);
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
@@ -4143,6 +4148,10 @@ bool GMainWindow::ConfirmForceLockedExit() {
}
void GMainWindow::RequestGameExit() {
+ if (!system->IsPoweredOn()) {
+ return;
+ }
+
auto& sm{system->ServiceManager()};
auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");