Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Enable browser hw accel toggle under Linux #11262

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions UI/obs-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,13 @@ bool OBSApp::InitGlobalConfigDefaults()

#ifdef _WIN32
config_set_default_bool(appConfig, "Audio", "DisableAudioDucking", true);
#endif

#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
config_set_default_bool(appConfig, "General", "BrowserHWAccel", true);
#endif

#ifdef __APPLE__
config_set_default_bool(appConfig, "General", "BrowserHWAccel", true);
config_set_default_bool(appConfig, "Video", "DisableOSXVSync", true);
config_set_default_bool(appConfig, "Video", "ResetOSXVSyncOnExit", true);
#endif
Expand Down Expand Up @@ -1265,7 +1267,7 @@ bool OBSApp::OBSInit()

obs_set_ui_task_handler(ui_task_handler);

#if defined(_WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
bool browserHWAccel = config_get_bool(appConfig, "General", "BrowserHWAccel");

OBSDataAutoRelease settings = obs_data_create();
Expand Down
10 changes: 5 additions & 5 deletions UI/window-basic-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
#ifdef _WIN32
HookWidget(ui->disableAudioDucking, CHECK_CHANGED, ADV_CHANGED);
#endif
#if defined(_WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
HookWidget(ui->browserHWAccel, CHECK_CHANGED, ADV_RESTART);
#endif
HookWidget(ui->filenameFormatting, EDIT_CHANGED, ADV_CHANGED);
Expand Down Expand Up @@ -639,7 +639,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->enableNewSocketLoop;
delete ui->enableLowLatencyMode;
delete ui->hideOBSFromCapture;
#ifdef __linux__
#if !defined(__APPLE__) && !defined(__linux__)
delete ui->browserHWAccel;
delete ui->sourcesGroup;
#endif
Expand All @@ -654,7 +654,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->enableNewSocketLoop = nullptr;
ui->enableLowLatencyMode = nullptr;
ui->hideOBSFromCapture = nullptr;
#ifdef __linux__
#if !defined(__APPLE__) && !defined(__linux__)
ui->browserHWAccel = nullptr;
ui->sourcesGroup = nullptr;
#endif
Expand Down Expand Up @@ -2614,7 +2614,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
ui->enableLowLatencyMode->setChecked(enableLowLatencyMode);
ui->enableLowLatencyMode->setToolTip(QTStr("Basic.Settings.Advanced.Network.TCPPacing.Tooltip"));
#endif
#if defined(_WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
bool browserHWAccel = config_get_bool(App()->GetAppConfig(), "General", "BrowserHWAccel");
ui->browserHWAccel->setChecked(browserHWAccel);
prevBrowserAccel = ui->browserHWAccel->isChecked();
Expand Down Expand Up @@ -3161,7 +3161,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
SaveCheckBox(ui->enableNewSocketLoop, "Output", "NewSocketLoopEnable");
SaveCheckBox(ui->enableLowLatencyMode, "Output", "LowLatencyEnable");
#endif
#if defined(_WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
bool browserHWAccel = ui->browserHWAccel->isChecked();
config_set_bool(App()->GetAppConfig(), "General", "BrowserHWAccel", browserHWAccel);
#endif
Expand Down
Loading