From f7e0a377536cc7e84c81173bd54ac2a45b39addf Mon Sep 17 00:00:00 2001
From: Valeri <v19930312@gmail.com>
Date: Wed, 17 Nov 2021 18:07:47 +0300
Subject: [PATCH] Prevent window flickering when holding Esc

Reported on discord by Levlight. Don't try to exit fullscreen if it's already off.
---
 src/yuzu/main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 4e5552d2a1..0bae95202f 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -975,7 +975,7 @@ void GMainWindow::InitializeHotkeys() {
             &QShortcut::activatedAmbiguously, ui->action_Fullscreen, &QAction::trigger);
     connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this),
             &QShortcut::activated, this, [&] {
-                if (emulation_running) {
+                if (emulation_running && ui->action_Fullscreen->isChecked()) {
                     ui->action_Fullscreen->setChecked(false);
                     ToggleFullscreen();
                 }