From d2c33df51294845a4e70e3a48c4f7a3d9a208417 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Sun, 19 Apr 2026 13:24:59 +0100 Subject: [PATCH] blockRoundedCorners: Invert if condition for readability --- src/citra_qt/citra_qt.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/citra_qt/citra_qt.cpp b/src/citra_qt/citra_qt.cpp index 4f0635d2e..62fb24b9b 100644 --- a/src/citra_qt/citra_qt.cpp +++ b/src/citra_qt/citra_qt.cpp @@ -165,17 +165,7 @@ public: HWND hwnd = reinterpret_cast(widget->winId()); DWORD pref; - if (!block) { - auto it = original_prefs.find(hwnd); - if (it == original_prefs.end()) - return; - - pref = it->second; - - DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref)); - - original_prefs.erase(it); - } else { + if (block) { pref = DWMWCP_DEFAULT; if (SUCCEEDED(DwmGetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref)))) { @@ -186,6 +176,16 @@ public: pref = DWMWCP_DONOTROUND; DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref)); + } else { + auto it = original_prefs.find(hwnd); + if (it == original_prefs.end()) + return; + + pref = it->second; + + DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref)); + + original_prefs.erase(it); } }