UI: Save last used output resolution to scene collection
This commit is contained in:
parent
78b6cf16c3
commit
46c00a95cd
2 changed files with 13 additions and 0 deletions
|
|
@ -847,6 +847,13 @@ void OBSBasic::Save(const char *file)
|
|||
}
|
||||
}
|
||||
|
||||
if (lastOutputResolution) {
|
||||
OBSDataAutoRelease res = obs_data_create();
|
||||
obs_data_set_int(res, "x", lastOutputResolution->first);
|
||||
obs_data_set_int(res, "y", lastOutputResolution->second);
|
||||
obs_data_set_obj(saveData, "resolution", res);
|
||||
}
|
||||
|
||||
if (!obs_data_save_json_safe(saveData, file, "tmp", "bak"))
|
||||
blog(LOG_ERROR, "Could not save scene data to %s", file);
|
||||
}
|
||||
|
|
@ -1077,6 +1084,7 @@ void OBSBasic::LogScenes()
|
|||
void OBSBasic::Load(const char *file)
|
||||
{
|
||||
disableSaving++;
|
||||
lastOutputResolution.reset();
|
||||
|
||||
obs_data_t *data = obs_data_create_from_json_file_safe(file, "bak");
|
||||
if (!data) {
|
||||
|
|
@ -7171,6 +7179,10 @@ inline void OBSBasic::OnActivate(bool force)
|
|||
App()->IncrementSleepInhibition();
|
||||
UpdateProcessPriority();
|
||||
|
||||
struct obs_video_info ovi;
|
||||
obs_get_video_info(&ovi);
|
||||
lastOutputResolution = {ovi.base_width, ovi.base_height};
|
||||
|
||||
TaskbarOverlaySetStatus(TaskbarOverlayStatusActive);
|
||||
if (trayIcon && trayIcon->isVisible()) {
|
||||
#ifdef __APPLE__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue