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.
This commit is contained in:
Crementif 2025-07-16 16:14:55 +02:00
parent 2d74bcfbfa
commit 42ff3ad468
2 changed files with 1 additions and 2 deletions

View file

@ -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 });