提交 4e5f20dc 编写于 作者: J jp9000

UI: Only apply new scaling behavior on newer installs

The new scaling behavior affects defaults, so only apply it to new
installs of 26.2 or greater, while maintaining the previous behavior if
the user is upgrading from an older version.
上级 5cdd084c
......@@ -777,6 +777,18 @@ bool OBSApp::InitGlobalConfig()
}
#undef PRE_24_1_DEFS
#define PRE_26_2_DEFS "Pre26.2Defaults"
if (!config_has_user_value(globalConfig, "General", PRE_26_2_DEFS)) {
bool useOldDefaults = lastVersion &&
lastVersion <
MAKE_SEMANTIC_VERSION(26, 2, 0);
config_set_bool(globalConfig, "General", PRE_26_2_DEFS,
useOldDefaults);
changed = true;
}
#undef PRE_26_2_DEFS
if (config_has_user_value(globalConfig, "BasicWindow",
"MultiviewLayout")) {
const char *layout = config_get_string(
......
......@@ -1218,13 +1218,19 @@ bool OBSBasic::InitBasicConfigDefaults()
uint32_t cx = primaryScreen->size().width();
uint32_t cy = primaryScreen->size().height();
bool oldScaleBehavior = config_get_bool(App()->GlobalConfig(),
"General", "Pre26.2Defaults");
/* after version 26.2, apply scaling to cx/cy */
if (!oldScaleBehavior) {
#ifdef SUPPORTS_FRACTIONAL_SCALING
cx *= devicePixelRatioF();
cy *= devicePixelRatioF();
cx *= devicePixelRatioF();
cy *= devicePixelRatioF();
#elif
cx *= devicePixelRatio();
cy *= devicePixelRatio();
cx *= devicePixelRatio();
cy *= devicePixelRatio();
#endif
}
bool oldResolutionDefaults = config_get_bool(
App()->GlobalConfig(), "General", "Pre19Defaults");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册