From 51c3058cf691ab49cb7f5349f43307f2093a86c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 2 Feb 2026 09:23:05 +0100 Subject: [PATCH] Replace "ForceFullScreen" with a way to prevent specific settings from being saved. --- Core/Config.cpp | 9 +++++++++ Core/Config.h | 14 ++++++------- Core/ConfigSettings.h | 6 +++++- Core/Dialog/PSPOskDialog.cpp | 2 +- Qt/QtMain.cpp | 2 +- Qt/mainwindow.cpp | 9 ++++----- SDL/CocoaBarItems.mm | 2 +- SDL/SDLMain.cpp | 17 +++++++--------- UI/ChatScreen.cpp | 2 +- UI/GameSettingsScreen.cpp | 7 +++---- UI/MainScreen.cpp | 6 ++---- UI/NativeApp.cpp | 6 ++++-- UWP/App.cpp | 5 ++--- Windows/MainWindow.cpp | 39 +++++++++++------------------------- Windows/MainWindow.h | 1 - Windows/MainWindowMenu.cpp | 2 +- Windows/main.cpp | 5 +++-- 17 files changed, 63 insertions(+), 71 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 00f9bf2b69..48f2b7e86c 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1381,6 +1381,10 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { INFO_LOG(Log::Loader, "Config loaded: '%s' (%0.1f ms)", iniFilename_.c_str(), (time_now_d() - startTime) * 1000.0); } +bool Config::ShouldSaveSetting(const void *ptr) const { + return std::find(settingsNotToSave_.begin(), settingsNotToSave_.end(), ptr) == settingsNotToSave_.end(); +} + // If we're in game specific mode, we need to: // * Save the game-specific settings to the game-specific ini file. // * Then, save the NON-game-specific settings ONLY to the regular ini file! @@ -1420,6 +1424,11 @@ bool Config::Save(const char *saveReason) { // Skip per-game settings in non-game-specific ini. continue; } + if (!ShouldSaveSetting(meta.settings[j].GetVoidPtr(configBlock))) { + // Skip settings marked as "don't save". + INFO_LOG(Log::System, "Not saving setting '%.*s' as marked as don't save.", STR_VIEW(meta.settings[j].IniKey())); + continue; + } meta.settings[j].WriteToIniSection(configBlock, section); } } diff --git a/Core/Config.h b/Core/Config.h index 3c89e2b25c..6503645764 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -306,7 +306,6 @@ public: int iAppSwitchMode; bool bFullScreen; bool bFullScreenMulti; - int iForceFullScreen = -1; // -1 = nope, 0 = force off, 1 = force on (not saved.) int iInternalResolution; // 0 = Auto (native), 1 = 1x (480x272), 2 = 2x, 3 = 3x, 4 = 4x and so on. int iAnisotropyLevel; // 0 - 5, powers of 2: 0 = 1x = no aniso int iMultiSampleLevel; @@ -690,12 +689,6 @@ public: int NextValidBackend(); bool IsBackendEnabled(GPUBackend backend); - bool UseFullScreen() const { - if (iForceFullScreen != -1) - return iForceFullScreen == 1; - return bFullScreen; - } - bool LoadAppendedConfig(); void SetAppendedConfigIni(const Path &path) { appendedConfigFileName_ = path; } void UpdateAfterSettingAutoFrameSkip(); @@ -718,6 +711,10 @@ public: static int GetDefaultValueInt(int *configSetting); + void DoNotSaveSetting(void *configSetting) { + settingsNotToSave_.push_back(configSetting); + } + private: void LoadStandardControllerIni(); @@ -747,6 +744,9 @@ private: Path appendedConfigFileName_; // A set make more sense, but won't have many entry, and I dont want to include the whole std::set header here std::vector appendedConfigUpdatedGames_; + std::vector settingsNotToSave_; + + bool ShouldSaveSetting(const void *configSetting) const; }; std::string CreateRandMAC(); diff --git a/Core/ConfigSettings.h b/Core/ConfigSettings.h index 035a32f5d8..04472b4fd0 100644 --- a/Core/ConfigSettings.h +++ b/Core/ConfigSettings.h @@ -212,7 +212,10 @@ struct ConfigSetting { return defaultCallback_.i ? defaultCallback_.i() : default_.i; } - std::string_view iniKey_; + std::string_view IniKey() const { + return iniKey_; + } + const char *ini2_ = nullptr; const char *ini3_ = nullptr; const char *ini4_ = nullptr; @@ -229,6 +232,7 @@ struct ConfigSetting { } private: + std::string_view iniKey_; CfgFlag flags_; DefaultValue default_{}; DefaultCallback defaultCallback_{}; diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 79806596fe..c1e9ef5716 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -891,7 +891,7 @@ int PSPOskDialog::Update(int animSpeed) { // Windows: Fall back to the OSK/continue normally if we're in fullscreen. // The dialog box doesn't work right if in fullscreen. if (System_GetPropertyBool(SYSPROP_HAS_KEYBOARD)) { - if (g_Config.bBypassOSKWithKeyboard && !g_Config.UseFullScreen()) + if (g_Config.bBypassOSKWithKeyboard && !g_Config.bFullScreen) return NativeKeyboard(); } #endif diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index 6997a1f0e4..c7d43a35ee 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -873,7 +873,7 @@ int main(int argc, char *argv[]) NativeInit(argc, (const char **)argv, savegame_dir.c_str(), external_dir.c_str(), nullptr); - g_mainWindow = new MainWindow(nullptr, g_Config.UseFullScreen()); + g_mainWindow = new MainWindow(nullptr, g_Config.bFullScreen); g_mainWindow->show(); // TODO: Support other backends than GL, like Vulkan, in the Qt backend. diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index d2ccd5820c..c0de52e460 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -60,16 +60,16 @@ void MainWindow::newFrame() { if (lastUIState != GetUIState()) { lastUIState = GetUIState(); - if (lastUIState == UISTATE_INGAME && g_Config.UseFullScreen() && !QApplication::overrideCursor() && !g_Config.bShowTouchControls) + if (lastUIState == UISTATE_INGAME && g_Config.bFullScreen && !QApplication::overrideCursor() && !g_Config.bShowTouchControls) QApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); - if (lastUIState != UISTATE_INGAME && g_Config.UseFullScreen() && QApplication::overrideCursor()) + if (lastUIState != UISTATE_INGAME && g_Config.bFullScreen && QApplication::overrideCursor()) QApplication::restoreOverrideCursor(); updateMenus(); } - if (g_Config.UseFullScreen() != isFullScreen()) - SetFullScreen(g_Config.UseFullScreen()); + if (g_Config.bFullScreen != isFullScreen()) + SetFullScreen(g_Config.bFullScreen); std::unique_lock lock(msgMutex_); while (!msgQueue_.empty()) { @@ -407,7 +407,6 @@ void MainWindow::fullscrAct() { // Toggle the current state. g_Config.bFullScreen = !isFullScreen(); - g_Config.iForceFullScreen = -1; SetFullScreen(g_Config.bFullScreen); QTimer::singleShot(1000, this, SLOT(raiseTopMost())); diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index a76cbe02f7..7a04794383 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -549,7 +549,7 @@ TOGGLE_METHOD_INVERSE(BreakOnLoad, g_Config.bAutoRun) TOGGLE_METHOD(IgnoreIllegalRWs, g_Config.bIgnoreBadMemAccess) TOGGLE_METHOD(AutoFrameSkip, g_Config.bAutoFrameSkip, g_Config.UpdateAfterSettingAutoFrameSkip()) TOGGLE_METHOD(SoftwareRendering, g_Config.bSoftwareRendering) -TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequestType::TOGGLE_FULLSCREEN_STATE, 0, g_Config.UseFullScreen() ? "1" : "0", "", 3, 0)) +TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequestType::TOGGLE_FULLSCREEN_STATE, 0, g_Config.bFullScreen ? "1" : "0", "", 3, 0)) // TOGGLE_METHOD(VSync, g_Config.bVSync) #undef TOGGLE_METHOD diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index ed43e56c62..0a843845c5 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -965,9 +965,8 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta Native_UpdateScreenScale(new_width_px, new_height_px, UIScaleFactorToMultiplier(g_Config.iUIScaleFactor)); // Set variable here in case fullscreen was toggled by hotkey - if (g_Config.UseFullScreen() != fullscreen) { + if (g_Config.bFullScreen != fullscreen) { g_Config.bFullScreen = fullscreen; - g_Config.iForceFullScreen = -1; } else { // It is possible for the monitor to change DPI, so recalculate // DPI on each resize event. @@ -1341,9 +1340,9 @@ void UpdateSDLCursor() { #if !defined(MOBILE_DEVICE) if (lastUIState != GetUIState()) { lastUIState = GetUIState(); - if (lastUIState == UISTATE_INGAME && g_Config.UseFullScreen() && !g_Config.bShowTouchControls) + if (lastUIState == UISTATE_INGAME && g_Config.bFullScreen && !g_Config.bShowTouchControls) SDL_ShowCursor(SDL_DISABLE); - if (lastUIState != UISTATE_INGAME || !g_Config.UseFullScreen()) + if (lastUIState != UISTATE_INGAME || !g_Config.bFullScreen) SDL_ShowCursor(SDL_ENABLE); } #endif @@ -1471,7 +1470,7 @@ int main(int argc, char *argv[]) { for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "--fullscreen")) { mode |= SDL_WINDOW_FULLSCREEN_DESKTOP; - g_Config.iForceFullScreen = 1; + g_Config.DoNotSaveSetting(&g_Config.bFullScreen); } else if (set_xres == -2) set_xres = parseInt(argv[i]); else if (set_yres == -2) @@ -1578,8 +1577,7 @@ int main(int argc, char *argv[]) { if (mode & SDL_WINDOW_FULLSCREEN_DESKTOP) { g_display.pixel_xres = g_DesktopWidth; g_display.pixel_yres = g_DesktopHeight; - if (g_Config.iForceFullScreen == -1) - g_Config.bFullScreen = true; + g_Config.bFullScreen = true; } else { // set a sensible default resolution (2x) g_display.pixel_xres = 480 * 2 * set_scale; @@ -1587,8 +1585,7 @@ int main(int argc, char *argv[]) { if (portrait) { std::swap(g_display.pixel_xres, g_display.pixel_yres); } - if (g_Config.iForceFullScreen == -1) - g_Config.bFullScreen = false; + g_Config.bFullScreen = false; } if (set_ipad) { @@ -1639,7 +1636,7 @@ int main(int argc, char *argv[]) { NativeInit(remain_argc, (const char **)remain_argv, path, external_dir, nullptr); // Use the setting from the config when initing the window. - if (g_Config.UseFullScreen()) + if (g_Config.bFullScreen) mode |= SDL_WINDOW_FULLSCREEN_DESKTOP; int x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(getDisplayNumber()); diff --git a/UI/ChatScreen.cpp b/UI/ChatScreen.cpp index 01d29b0b25..2e420210b0 100644 --- a/UI/ChatScreen.cpp +++ b/UI/ChatScreen.cpp @@ -178,7 +178,7 @@ void ChatMenu::Update() { #if defined(USING_WIN_UI) // Could remove the fullscreen check here, it works now. auto n = GetI18NCategory(I18NCat::NETWORKING); - if (promptInput_ && g_Config.bBypassOSKWithKeyboard && !g_Config.UseFullScreen()) { + if (promptInput_ && g_Config.bBypassOSKWithKeyboard && !g_Config.bFullScreen) { System_InputBoxGetString(token_, n->T("Chat"), n->T("Chat Here"), false, [](const std::string &value, int) { sendChat(value); }); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 43913fe9a2..1c5975b6ac 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -417,7 +417,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) if (System_GetPropertyInt(SYSPROP_DISPLAY_COUNT) > 1) { CheckBox *fullscreenMulti = new CheckBox(&g_Config.bFullScreenMulti, gr->T("Use all displays")); fullscreenMulti->SetEnabledFunc([] { - return g_Config.UseFullScreen(); + return g_Config.bFullScreen; }); graphicsSettings->Add(fullscreenMulti)->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenMultiChange); } @@ -1622,12 +1622,11 @@ void GameSettingsScreen::OnChangeBackground(UI::EventParams &e) { } void GameSettingsScreen::OnFullscreenChange(UI::EventParams &e) { - g_Config.iForceFullScreen = -1; - System_ToggleFullscreenState(g_Config.UseFullScreen() ? "1" : "0"); + System_ToggleFullscreenState(g_Config.bFullScreen ? "1" : "0"); } void GameSettingsScreen::OnFullscreenMultiChange(UI::EventParams &e) { - System_ToggleFullscreenState(g_Config.UseFullScreen() ? "1" : "0"); + System_ToggleFullscreenState(g_Config.bFullScreen ? "1" : "0"); } void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult result) { diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 48407b83be..fa25a16c33 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1428,7 +1428,7 @@ void MainScreen::CreateViews() { ViewGroup *logo = new LogoView(false, new LinearLayoutParams(FILL_PARENT, 80.0f)); #if !defined(MOBILE_DEVICE) auto gr = GetI18NCategory(I18NCat::GRAPHICS); - ImageID icon(g_Config.UseFullScreen() ? "I_RESTORE" : "I_FULLSCREEN"); + ImageID icon(g_Config.bFullScreen ? "I_RESTORE" : "I_FULLSCREEN"); fullscreenButton_ = logo->Add(new Button(gr->T("FullScreen", "Full Screen"), icon, new AnchorLayoutParams(48, 48, NONE, 0, 0, NONE, Centering::None))); fullscreenButton_->SetIgnoreText(true); fullscreenButton_->OnClick.Handle(this, &MainScreen::OnFullScreenToggle); @@ -1511,10 +1511,8 @@ void MainScreen::OnLoadFile(UI::EventParams &e) { } void MainScreen::OnFullScreenToggle(UI::EventParams &e) { - if (g_Config.iForceFullScreen != -1) - g_Config.bFullScreen = g_Config.UseFullScreen(); if (fullscreenButton_) { - fullscreenButton_->SetImageID(ImageID(!g_Config.UseFullScreen() ? "I_RESTORE" : "I_FULLSCREEN")); + fullscreenButton_->SetImageID(ImageID(!g_Config.bFullScreen ? "I_RESTORE" : "I_FULLSCREEN")); } #if !defined(MOBILE_DEVICE) g_Config.bFullScreen = !g_Config.bFullScreen; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ff8064c997..b39e55a5de 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -580,14 +580,16 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch if (!strncmp(argv[i], "--pause-menu-exit", strlen("--pause-menu-exit"))) g_Config.bPauseMenuExitsEmulator = true; if (!strcmp(argv[i], "--fullscreen")) { - g_Config.iForceFullScreen = 1; + g_Config.DoNotSaveSetting(&g_Config.bFullScreen); + g_Config.bFullScreen = true; System_ToggleFullscreenState("1"); } if (!strncmp(argv[i], "--root=", strlen("--root=")) && strlen(argv[i]) > strlen("--root=")) { g_Config.mountRoot = Path(argv[i] + strlen("--root=")); } if (!strcmp(argv[i], "--windowed")) { - g_Config.iForceFullScreen = 0; + g_Config.DoNotSaveSetting(&g_Config.bFullScreen); + g_Config.bFullScreen = false; System_ToggleFullscreenState("0"); } if (!strcmp(argv[i], "--touchscreentest")) diff --git a/UWP/App.cpp b/UWP/App.cpp index 48bfc60048..ef75269702 100644 --- a/UWP/App.cpp +++ b/UWP/App.cpp @@ -264,9 +264,9 @@ void App::OnActivated(const CoreApplicationView& applicationView, const IActivat CoreWindow::GetForCurrentThread().Activate(); // On mobile, we force-enter fullscreen mode. if (m_isPhone) - g_Config.iForceFullScreen = 1; + g_Config.bFullScreen = true; - if (g_Config.UseFullScreen()) + if (g_Config.bFullScreen) winrt::Windows::UI::ViewManagement::ApplicationView::GetForCurrentView().TryEnterFullScreenMode(); //Detect if app started or activated by launch item (file, uri) @@ -300,7 +300,6 @@ void App::OnResuming(const IInspectable& sender, const IInspectable& args) { void App::OnWindowSizeChanged(const CoreWindow& sender, const WindowSizeChangedEventArgs& args) { auto view = winrt::Windows::UI::ViewManagement::ApplicationView::GetForCurrentView(); g_Config.bFullScreen = view.IsFullScreenMode(); - g_Config.iForceFullScreen = -1; float width = sender.Bounds().Width; float height = sender.Bounds().Height; diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index 8aa4c5c370..60010f238a 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -155,7 +155,6 @@ namespace MainWindow { static bool inFullscreenResize = false; static bool inResizeMove = false; static bool hasFocus = true; - static bool g_isFullscreen = false; static bool g_keepScreenBright = false; static bool disasmMapLoadPending = false; @@ -194,7 +193,7 @@ namespace MainWindow { } void SavePosition() { - if (g_Config.UseFullScreen() || inFullscreenResize) + if (g_Config.bFullScreen || inFullscreenResize) return; WINDOWPLACEMENT placement{}; @@ -242,7 +241,7 @@ namespace MainWindow { } void CorrectCursor() { - bool autoHide = ((g_Config.UseFullScreen() && !mouseButtonDown) || (g_Config.bMouseControl && trapMouse)) && GetUIState() == UISTATE_INGAME; + bool autoHide = ((g_Config.bFullScreen && !mouseButtonDown) || (g_Config.bMouseControl && trapMouse)) && GetUIState() == UISTATE_INGAME; if (autoHide && (hideCursor || g_Config.bMouseControl)) { while (cursorCounter >= 0) { cursorCounter = ShowCursor(FALSE); @@ -290,7 +289,7 @@ namespace MainWindow { } // Don't save the window state if fullscreen. - if (!g_Config.UseFullScreen()) { + if (!g_Config.bFullScreen) { g_WindowState = newSizingType; } } @@ -337,11 +336,7 @@ namespace MainWindow { // Remove the menu bar if going fullscreen. This can trigger WM_SIZE because the contents change size. ::SetMenu(hWnd, goingFullscreen || !g_Config.bShowMenuBar ? NULL : g_hMenu); - if (g_Config.UseFullScreen() != goingFullscreen) { - g_Config.bFullScreen = goingFullscreen; - g_Config.iForceFullScreen = -1; - } - g_isFullscreen = goingFullscreen; + g_Config.bFullScreen = goingFullscreen; g_IgnoreWM_SIZE = false; @@ -402,7 +397,7 @@ namespace MainWindow { bool resetPositionX = true; bool resetPositionY = true; - if (g_Config.iWindowWidth > 0 && g_Config.iWindowHeight > 0 && !g_Config.UseFullScreen()) { + if (g_Config.iWindowWidth > 0 && g_Config.iWindowHeight > 0 && !g_Config.bFullScreen) { bool visibleHorizontally = ((g_Config.iWindowX + g_Config.iWindowWidth) >= virtualScreenX) && ((g_Config.iWindowX + g_Config.iWindowWidth) < (virtualScreenWidth + g_Config.iWindowWidth)); @@ -507,7 +502,7 @@ namespace MainWindow { hideCursor = true; SetTimer(hwndMain, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0); - ToggleFullscreen(hwndMain, g_Config.UseFullScreen()); + ToggleFullscreen(hwndMain, g_Config.bFullScreen); W32Util::MakeTopMost(hwndMain, g_Config.bTopMost); @@ -657,28 +652,23 @@ namespace MainWindow { // Return game ID as four u32 values // wParam: 0-3 = which u32 to return (chars 0-3, 4-7, 8-11, 12-15) // Returns: packed u32 with 4 bytes of game ID - if (!PSP_IsInited()) - { + if (!PSP_IsInited()) { return 0; } const std::string gameID = Reporting::CurrentGameID(); - if (gameID.empty()) - { + if (gameID.empty()) { return 0; } const size_t offset = (wParam & 0x3) * 4; // 0, 4, 8, 12 u32 packed = 0; - for (size_t i = 0; i < 4; ++i) - { - if (offset + i < gameID.length()) - { + for (size_t i = 0; i < 4; ++i) { + if (offset + i < gameID.length()) { const u8 c = static_cast(gameID[offset + i]); packed |= ((u32)c << (i * 8)); } } return packed; } - break; case WM_USER_GET_MODULE_INFO: { // Get module information by name @@ -722,7 +712,6 @@ namespace MainWindow { // Module not found return 0; } - break; // Hack to kill the white line underneath the menubar. // From https://stackoverflow.com/questions/57177310/how-to-paint-over-white-line-between-menu-bar-and-client-area-of-window @@ -755,8 +744,8 @@ namespace MainWindow { AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, TRUE); minmax->ptMinTrackSize.x = rc.right - rc.left; minmax->ptMinTrackSize.y = rc.bottom - rc.top; + return 0; } - return 0; case WM_ACTIVATE: { @@ -1138,7 +1127,7 @@ namespace MainWindow { const float dy = lastMouseDownY - y; const float distSq = dx * dx + dy * dy; if (distSq < 3.0f*3.0f && !g_Config.bShowTouchControls && !g_Config.bShowImDebugger && !g_Config.bMouseControl && GetUIState() == UISTATE_INGAME && g_Config.bFullscreenOnDoubleclick) { - SendToggleFullscreen(!g_Config.UseFullScreen()); + SendToggleFullscreen(!g_Config.bFullScreen); } lastMouseDownTime = 0.0; } else { @@ -1252,10 +1241,6 @@ namespace MainWindow { PostMessage(hwndMain, WM_USER_TOGGLE_FULLSCREEN, fullscreen, 0); } - bool IsFullscreen() { - return g_isFullscreen; - } - void RunCallbackInWndProc(void (*callback)(void *, void *), void *userdata) { PostMessage(hwndMain, WM_USER_RUN_CALLBACK, reinterpret_cast(callback), reinterpret_cast(userdata)); } diff --git a/Windows/MainWindow.h b/Windows/MainWindow.h index e80c376ab3..cd3a1c44f9 100644 --- a/Windows/MainWindow.h +++ b/Windows/MainWindow.h @@ -75,7 +75,6 @@ namespace MainWindow void ToggleFullscreen(HWND hWnd, bool goingFullscreen); void Minimize(); void SendToggleFullscreen(bool fullscreen); // To be used off-thread - bool IsFullscreen(); void ToggleDebugConsoleVisibility(); void SetInternalResolution(int res = -1); void SetWindowSize(int zoom); diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index fd30325bea..8cccf6223a 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -882,7 +882,7 @@ namespace MainWindow { case ID_OPTIONS_FULLSCREEN: if (!g_Config.bShowImDebugger) { - SendToggleFullscreen(!g_Config.UseFullScreen()); + SendToggleFullscreen(!g_Config.bFullScreen); } break; diff --git a/Windows/main.cpp b/Windows/main.cpp index cd836bee74..4b52ba4dd5 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -726,7 +726,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string case SystemRequestType::TOGGLE_FULLSCREEN_STATE: { - bool flag = !MainWindow::IsFullscreen(); + bool flag = !g_Config.bFullScreen; if (param1 == "0") { flag = false; } else if (param1 == "1") { @@ -1122,7 +1122,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin if (iCmdShow == SW_MAXIMIZE) { // Consider this to mean --fullscreen. - g_Config.iForceFullScreen = 1; + g_Config.bFullScreen = true; + g_Config.DoNotSaveSetting(&g_Config.bFullScreen); } // Consider at least the following cases before changing this code: