From cd42f8b3a6d60cd1046d0da8d93ae6c2807642cb Mon Sep 17 00:00:00 2001 From: iota97 Date: Sat, 10 Oct 2020 15:22:59 +0200 Subject: [PATCH] Make --windowed available on all platform and make sure to trigger resize --- UI/NativeApp.cpp | 8 +++++++- Windows/main.cpp | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ef7547d411..d9ac927aef 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -595,8 +595,14 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch #endif if (!strncmp(argv[i], "--pause-menu-exit", strlen("--pause-menu-exit"))) g_Config.bPauseMenuExitsEmulator = true; - if (!strcmp(argv[i], "--fullscreen")) + if (!strcmp(argv[i], "--fullscreen")) { g_Config.bFullScreen = true; + System_SendMessage("toggle_fullscreen", "1"); + } + if (!strcmp(argv[i], "--windowed")) { + g_Config.bFullScreen = false; + System_SendMessage("toggle_fullscreen", "0"); + } if (!strcmp(argv[i], "--touchscreentest")) gotoTouchScreenTest = true; if (!strcmp(argv[i], "--gamesettings")) diff --git a/Windows/main.cpp b/Windows/main.cpp index 3abdd7dfb0..3ffe67259e 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -564,9 +564,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin break; } - if (wideArgs[i] == L"--windowed") - g_Config.bFullScreen = false; - if (wideArgs[i].find(gpuBackend) != std::wstring::npos && wideArgs[i].size() > gpuBackend.size()) { const std::wstring restOfOption = wideArgs[i].substr(gpuBackend.size());