Merge pull request #3317 from cg2121/projector-fix

UI: Fix always on top w/ projectors on Linux
master
Jim 2020-08-23 10:49:25 -07:00 committed by GitHub
commit 1047cb3ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

View File

@ -4076,6 +4076,16 @@ void OBSBasic::EnumDialogs()
}
}
void OBSBasic::ClearProjectors()
{
for (size_t i = 0; i < projectors.size(); i++) {
if (projectors[i])
delete projectors[i];
}
projectors.clear();
}
void OBSBasic::ClearSceneData()
{
disableSaving++;
@ -4088,12 +4098,7 @@ void OBSBasic::ClearSceneData()
ClearQuickTransitions();
ui->transitions->clear();
for (size_t i = 0; i < projectors.size(); i++) {
if (projectors[i])
delete projectors[i];
}
projectors.clear();
ClearProjectors();
obs_set_output_source(0, nullptr);
obs_set_output_source(1, nullptr);
@ -8264,6 +8269,15 @@ void OBSBasic::UpdateProjectorAlwaysOnTop(bool top)
SetAlwaysOnTop(projectors[i], top);
}
void OBSBasic::ResetProjectors()
{
obs_data_array_t *savedProjectorList = SaveProjectors();
ClearProjectors();
LoadSavedProjectors(savedProjectorList);
OpenSavedProjectors();
obs_data_array_release(savedProjectorList);
}
void OBSBasic::on_sourcePropertiesButton_clicked()
{
on_actionSourceProperties_triggered();

View File

@ -347,6 +347,7 @@ private:
void CloseDialogs();
void ClearSceneData();
void ClearProjectors();
void Nudge(int dist, MoveDir dir);
@ -530,6 +531,7 @@ private:
void UpdateProjectorHideCursor();
void UpdateProjectorAlwaysOnTop(bool top);
void ResetProjectors();
QPointer<QObject> screenshotData;

View File

@ -2958,8 +2958,12 @@ void OBSBasicSettings::SaveGeneralSettings()
config_set_bool(GetGlobalConfig(), "BasicWindow",
"ProjectorAlwaysOnTop",
ui->projectorAlwaysOnTop->isChecked());
#if defined(_WIN32) || defined(__APPLE__)
main->UpdateProjectorAlwaysOnTop(
ui->projectorAlwaysOnTop->isChecked());
#else
main->ResetProjectors();
#endif
}
if (WidgetChanged(ui->recordWhenStreaming))