0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Limit default canvas res to 1920x1080 or below

The reasoning behind this is because having a very large canvas size can
negatively affect the user experience -- most sources end up seeming
smaller than they need to be to users, resulting in the user needing to
size up the sources, or in the case of webcams it makes the user try to
use much larger webcam resolutions than they should reasonably need to
do, resulting in higher unintentional resource usage.  The program will
additionally require more fillrate to render and downscale things as
well.

This applies only to the default starting base/canvas resolution for new
users only.

Additionally, users that ran the program pre-19 will be unaffected by
this change, as it will detect that and set the old defaults to prevent
an unexpected change in resolution for those users.
This commit is contained in:
jp9000 2017-04-28 18:02:03 -07:00
parent ca0d4d18d5
commit 9d019e90ab
2 changed files with 28 additions and 0 deletions

View File

@ -583,6 +583,7 @@ static string GetSceneCollectionFileFromName(const char *name)
bool OBSApp::InitGlobalConfig()
{
char path[512];
bool changed = false;
int len = GetConfigPath(path, sizeof(path),
"obs-studio/global.ini");
@ -606,6 +607,7 @@ bool OBSApp::InitGlobalConfig()
config_set_string(globalConfig,
"Basic", "SceneCollectionFile",
path.c_str());
changed = true;
}
}
@ -617,9 +619,24 @@ bool OBSApp::InitGlobalConfig()
opt_starting_profile.c_str());
config_set_string(globalConfig, "Basic", "ProfileDir",
path.c_str());
changed = true;
}
}
if (!config_has_user_value(globalConfig, "General", "OldDefaults")) {
uint32_t lastVersion = config_get_int(globalConfig, "General",
"LastVersion");
bool useOldDefaults = lastVersion &&
lastVersion < MAKE_SEMANTIC_VERSION(19, 0, 0);
config_set_bool(globalConfig, "General", "Pre19Defaults",
useOldDefaults);
changed = true;
}
if (changed)
config_save_safe(globalConfig, "tmp", nullptr);
return InitGlobalConfigDefaults();
}

View File

@ -913,6 +913,17 @@ bool OBSBasic::InitBasicConfigDefaults()
uint32_t cx = primaryScreen->size().width();
uint32_t cy = primaryScreen->size().height();
bool oldResolutionDefaults = config_get_bool(App()->GlobalConfig(),
"General", "Pre19Defaults");
/* use 1920x1080 for new default base res if main monitor is above
* 1920x1080, but don't apply for people from older builds -- only to
* new users */
if (!oldResolutionDefaults && (cx * cy) > (1920 * 1080)) {
cx = 1920;
cy = 1080;
}
/* ----------------------------------------------------- */
/* move over mixer values in advanced if older config */
if (config_has_user_value(basicConfig, "AdvOut", "RecTrackIndex") &&