Skip to content

Commit 163dba9

Browse files
committed
Fix custom provider being saved into config despite an official one being selected
1 parent d6876e6 commit 163dba9

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎OptiScaler/menu/menu_common.cpp‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,17 +1248,21 @@ void MenuCommon::RenderUpscalerCombo(const API api, Upscaler currentUpscaler, co
12481248
State::Instance().newBackend = entry.upscaler;
12491249

12501250
// Regular and custom entries share an upscaler type, which the backend change check compares,
1251-
// so a switch between them is marked here
1251+
// so a switch between them is marked here. A regular entry always clears the custom name, which the
1252+
// ini would otherwise save in place of it.
12521253
if (auto& customSetting = CustomProviders::NameSetting(api);
1253-
!selected && entry.custom != customSetting.value_or("") &&
1254-
(!entry.custom.empty() || CustomProviders::Runs(customSetting.value_or(""), api, entry.upscaler)))
1254+
!selected && entry.custom != customSetting.value_or(""))
12551255
{
1256+
const bool typeUnchanged =
1257+
!entry.custom.empty() || CustomProviders::Runs(customSetting.value_or(""), api, entry.upscaler);
1258+
12561259
if (entry.custom.empty())
12571260
customSetting.reset();
12581261
else
12591262
customSetting = entry.custom;
12601263

1261-
MARK_ALL_BACKENDS_CHANGED();
1264+
if (typeUnchanged)
1265+
MARK_ALL_BACKENDS_CHANGED();
12621266
}
12631267
}
12641268

0 commit comments

Comments
 (0)