From 8ba06aa4e1da6dc7b4fa761dba28165d8a634f84 Mon Sep 17 00:00:00 2001
From: FearlessTobi <thm.frey@gmail.com>
Date: Sat, 28 Mar 2020 02:31:35 +0100
Subject: [PATCH] yuzu: fix the stuck in fullscreen mode bug

Co-Authored-By: Valentin Vanelslande <vvanelslandedev@gmail.com>
---
 src/yuzu/main.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 4769a612e..415a64b1e 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -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();