From 42ff3ad4683647cf82b616e1990a0df855282c59 Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:14:55 +0200 Subject: [PATCH] Fix debug assert that'd occur when closing the debug menu Closing the settings window will immediately flush a temporary 0, 0 value it writes for the size which gets overwritten by the MainWindow a few seconds later. In the code, -1 is considered the "off" state, and 0 is considered a "it should be saved, but only whenever the value is available". The save gamepad size/pos option already worked like this new behavior, since you might enable the option but not (previously) have it open yet. When encountering a 0 as the size, it'll just use the default window size of Cemu. --- src/gui/wxgui/MainWindow.cpp | 2 +- src/gui/wxgui/wxCemuConfig.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/wxgui/MainWindow.cpp b/src/gui/wxgui/MainWindow.cpp index c1826ae5..bdc0db20 100644 --- a/src/gui/wxgui/MainWindow.cpp +++ b/src/gui/wxgui/MainWindow.cpp @@ -1299,7 +1299,7 @@ void MainWindow::LoadSettings() if (config.window_position != Vector2i{ -1,-1 }) this->SetPosition({ config.window_position.x, config.window_position.y }); - if (config.window_size != Vector2i{ -1,-1 }) + if (config.window_size.x > 0 && config.window_size.y > 0) { this->SetSize({ config.window_size.x, config.window_size.y }); diff --git a/src/gui/wxgui/wxCemuConfig.cpp b/src/gui/wxgui/wxCemuConfig.cpp index 87355797..e6a2b469 100644 --- a/src/gui/wxgui/wxCemuConfig.cpp +++ b/src/gui/wxgui/wxCemuConfig.cpp @@ -136,7 +136,6 @@ void wxCemuConfig::Save(XMLConfigParser& config) wpos.set("y", window_position.y); auto wsize = config.set("window_size"); wsize.set("x", window_size.x); - cemu_assert_debug(window_size.x != 0); wsize.set("y", window_size.y); config.set("window_maximized", window_maximized);