UI: Add option to disable aero on windows vista/7
On windows vista/7, you cannot really use display capture efficiently without disabling aero, so this will add an option to settings to allow it to be disabled and cause it to be disabled on startup.master
parent
0c631db046
commit
e7eaa268e5
|
@ -324,6 +324,7 @@ Basic.Settings.Video.Denominator="Denominator:"
|
||||||
Basic.Settings.Video.Renderer="Renderer:"
|
Basic.Settings.Video.Renderer="Renderer:"
|
||||||
Basic.Settings.Video.InvalidResolution="Invalid resolution value. Must be [width]x[height] (i.e. 1920x1080)"
|
Basic.Settings.Video.InvalidResolution="Invalid resolution value. Must be [width]x[height] (i.e. 1920x1080)"
|
||||||
Basic.Settings.Video.CurrentlyActive="Video output is currently active. Please turn off any outputs to change video settings."
|
Basic.Settings.Video.CurrentlyActive="Video output is currently active. Please turn off any outputs to change video settings."
|
||||||
|
Basic.Settings.Video.DisableAero="Disable Aero"
|
||||||
|
|
||||||
# scale filters
|
# scale filters
|
||||||
Basic.Settings.Video.DownscaleFilter.Bilinear="Bilinear (Fastest, but blurry if scaling)"
|
Basic.Settings.Video.DownscaleFilter.Bilinear="Bilinear (Fastest, but blurry if scaling)"
|
||||||
|
|
|
@ -683,6 +683,15 @@ void OBSBasic::OBSInit()
|
||||||
if (!previewEnabled)
|
if (!previewEnabled)
|
||||||
QMetaObject::invokeMethod(this, "TogglePreview",
|
QMetaObject::invokeMethod(this, "TogglePreview",
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
uint32_t winVer = GetWindowsVersion();
|
||||||
|
if (winVer > 0 && winVer < 0x602) {
|
||||||
|
bool disableAero = config_get_bool(basicConfig, "Video",
|
||||||
|
"DisableAero");
|
||||||
|
SetAeroEnabled(!disableAero);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::InitHotkeys()
|
void OBSBasic::InitHotkeys()
|
||||||
|
@ -888,6 +897,17 @@ OBSBasic::~OBSBasic()
|
||||||
config_set_bool(App()->GlobalConfig(), "BasicWindow", "PreviewEnabled",
|
config_set_bool(App()->GlobalConfig(), "BasicWindow", "PreviewEnabled",
|
||||||
previewEnabled);
|
previewEnabled);
|
||||||
config_save(App()->GlobalConfig());
|
config_save(App()->GlobalConfig());
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
uint32_t winVer = GetWindowsVersion();
|
||||||
|
if (winVer > 0 && winVer < 0x602) {
|
||||||
|
bool disableAero = config_get_bool(basicConfig, "Video",
|
||||||
|
"DisableAero");
|
||||||
|
if (disableAero) {
|
||||||
|
SetAeroEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasic::SaveProject()
|
void OBSBasic::SaveProject()
|
||||||
|
|
|
@ -187,6 +187,13 @@ static CodecDesc GetDefaultCodecDesc(const ff_format_desc *formatDesc,
|
||||||
id);
|
id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
void OBSBasicSettings::ToggleDisableAero(bool checked)
|
||||||
|
{
|
||||||
|
SetAeroEnabled(!checked);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
||||||
const char *slot)
|
const char *slot)
|
||||||
{
|
{
|
||||||
|
@ -308,6 +315,22 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||||
HookWidget(ui->colorSpace, COMBO_CHANGED, ADV_CHANGED);
|
HookWidget(ui->colorSpace, COMBO_CHANGED, ADV_CHANGED);
|
||||||
HookWidget(ui->colorRange, COMBO_CHANGED, ADV_CHANGED);
|
HookWidget(ui->colorRange, COMBO_CHANGED, ADV_CHANGED);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
uint32_t winVer = GetWindowsVersion();
|
||||||
|
if (winVer > 0 && winVer < 0x602) {
|
||||||
|
toggleAero = new QCheckBox(
|
||||||
|
QTStr("Basic.Settings.Video.DisableAero"),
|
||||||
|
this);
|
||||||
|
QFormLayout *videoLayout =
|
||||||
|
reinterpret_cast<QFormLayout*>(ui->videoPage->layout());
|
||||||
|
videoLayout->addRow(nullptr, toggleAero);
|
||||||
|
|
||||||
|
HookWidget(toggleAero, CHECK_CHANGED, VIDEO_CHANGED);
|
||||||
|
connect(toggleAero, &QAbstractButton::toggled,
|
||||||
|
this, &OBSBasicSettings::ToggleDisableAero);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//Apply button disabled until change.
|
//Apply button disabled until change.
|
||||||
EnableApplyButton(false);
|
EnableApplyButton(false);
|
||||||
|
|
||||||
|
@ -871,6 +894,16 @@ void OBSBasicSettings::LoadVideoSettings()
|
||||||
LoadFPSData();
|
LoadFPSData();
|
||||||
LoadDownscaleFilters();
|
LoadDownscaleFilters();
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (toggleAero) {
|
||||||
|
bool disableAero = config_get_bool(main->Config(), "Video",
|
||||||
|
"DisableAero");
|
||||||
|
toggleAero->setChecked(disableAero);
|
||||||
|
|
||||||
|
aeroWasDisabled = disableAero;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1827,6 +1860,13 @@ void OBSBasicSettings::SaveVideoSettings()
|
||||||
SaveSpinBox(ui->fpsNumerator, "Video", "FPSNum");
|
SaveSpinBox(ui->fpsNumerator, "Video", "FPSNum");
|
||||||
SaveSpinBox(ui->fpsDenominator, "Video", "FPSDen");
|
SaveSpinBox(ui->fpsDenominator, "Video", "FPSDen");
|
||||||
SaveComboData(ui->downscaleFilter, "Video", "ScaleType");
|
SaveComboData(ui->downscaleFilter, "Video", "ScaleType");
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (toggleAero) {
|
||||||
|
SaveCheckBox(toggleAero, "Video", "DisableAero");
|
||||||
|
aeroWasDisabled = toggleAero->isChecked();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSBasicSettings::SaveAdvancedSettings()
|
void OBSBasicSettings::SaveAdvancedSettings()
|
||||||
|
@ -2098,12 +2138,17 @@ bool OBSBasicSettings::QueryChanges()
|
||||||
QMessageBox::Yes | QMessageBox::No |
|
QMessageBox::Yes | QMessageBox::No |
|
||||||
QMessageBox::Cancel);
|
QMessageBox::Cancel);
|
||||||
|
|
||||||
if (button == QMessageBox::Cancel)
|
if (button == QMessageBox::Cancel) {
|
||||||
return false;
|
return false;
|
||||||
else if (button == QMessageBox::Yes)
|
} else if (button == QMessageBox::Yes) {
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
else
|
} else {
|
||||||
LoadSettings(true);
|
LoadSettings(true);
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (toggleAero)
|
||||||
|
SetAeroEnabled(!aeroWasDisabled);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
ClearChanged();
|
ClearChanged();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
class OBSBasic;
|
class OBSBasic;
|
||||||
class QAbstractButton;
|
class QAbstractButton;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
class QCheckBox;
|
||||||
class OBSPropertiesView;
|
class OBSPropertiesView;
|
||||||
class OBSHotkeyWidget;
|
class OBSHotkeyWidget;
|
||||||
|
|
||||||
|
@ -152,6 +153,12 @@ private:
|
||||||
EnableApplyButton(false);
|
EnableApplyButton(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
bool aeroWasDisabled = false;
|
||||||
|
QCheckBox *toggleAero = nullptr;
|
||||||
|
void ToggleDisableAero(bool checked);
|
||||||
|
#endif
|
||||||
|
|
||||||
void HookWidget(QWidget *widget, const char *signal, const char *slot);
|
void HookWidget(QWidget *widget, const char *signal, const char *slot);
|
||||||
|
|
||||||
bool QueryChanges();
|
bool QueryChanges();
|
||||||
|
|
Loading…
Reference in New Issue