Skip to content

Commit 42ff3ad

Browse files
committed
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.
1 parent 2d74bcf commit 42ff3ad

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/gui/wxgui/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ void MainWindow::LoadSettings()
12991299
if (config.window_position != Vector2i{ -1,-1 })
13001300
this->SetPosition({ config.window_position.x, config.window_position.y });
13011301

1302-
if (config.window_size != Vector2i{ -1,-1 })
1302+
if (config.window_size.x > 0 && config.window_size.y > 0)
13031303
{
13041304
this->SetSize({ config.window_size.x, config.window_size.y });
13051305

src/gui/wxgui/wxCemuConfig.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ void wxCemuConfig::Save(XMLConfigParser& config)
136136
wpos.set<sint32>("y", window_position.y);
137137
auto wsize = config.set("window_size");
138138
wsize.set<sint32>("x", window_size.x);
139-
cemu_assert_debug(window_size.x != 0);
140139
wsize.set<sint32>("y", window_size.y);
141140
config.set<bool>("window_maximized", window_maximized);
142141

0 commit comments

Comments
 (0)