From 61aeaa5ca39264a7606d065c58d29b150032efb8 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Mon, 18 Mar 2019 14:45:05 -0500 Subject: [PATCH 1/3] obs-browser: Enable Linux support This requires CEF >= 3683 --- UI/obs-app.cpp | 4 ++++ plugins/CMakeLists.txt | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 330d26e7e..bcee173b3 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1763,6 +1763,10 @@ static int run_program(fstream &logFile, int argc, char *argv[]) QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif +#if !defined(_WIN32) && !defined(__APPLE__) && BROWSER_AVAILABLE + setenv("QT_NO_GLIB", "1", true); +#endif + QCoreApplication::addLibraryPath("."); #if __APPLE__ diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 2091e3f67..b08112150 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -48,20 +48,20 @@ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD") add_subdirectory(linux-jack) endif() -if(WIN32 OR APPLE) - option(BUILD_BROWSER "Build browser plugin" OFF) - if (BUILD_BROWSER) - if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt") - add_subdirectory(obs-browser) - set(BROWSER_AVAILABLE_INTERNAL ON CACHE BOOL "Internal global cmake variable" FORCE) - else() - message(STATUS "obs-browser submodule not found! Please fetch submodules. obs-browser plugin disabled.") - set(BROWSER_AVAILABLE_INTERNAL OFF CACHE BOOL "Internal global cmake variable" FORCE) - endif() +option(BUILD_BROWSER "Build browser plugin" OFF) +if (BUILD_BROWSER) + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt") + add_subdirectory(obs-browser) + set(BROWSER_AVAILABLE_INTERNAL ON CACHE BOOL "Internal global cmake variable" FORCE) else() + message(STATUS "obs-browser submodule not found! Please fetch submodules. obs-browser plugin disabled.") set(BROWSER_AVAILABLE_INTERNAL OFF CACHE BOOL "Internal global cmake variable" FORCE) endif() +else() + set(BROWSER_AVAILABLE_INTERNAL OFF CACHE BOOL "Internal global cmake variable" FORCE) +endif() +if(WIN32 OR APPLE) if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-vst/CMakeLists.txt") add_subdirectory(obs-vst) else() From 0b33df9b2fbf86036074fbe12ced9da754e0f492 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Sat, 23 Mar 2019 12:30:02 -0500 Subject: [PATCH 2/3] CI: Build CEF on Linux --- CI/before-script-linux.sh | 2 +- CI/install-dependencies-linux.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CI/before-script-linux.sh b/CI/before-script-linux.sh index a45d1e6b4..31e154410 100755 --- a/CI/before-script-linux.sh +++ b/CI/before-script-linux.sh @@ -8,4 +8,4 @@ fi set -ex ccache -s || echo "CCache is not available." mkdir build && cd build -cmake -DBUILD_CAPTIONS=ON .. +cmake -DBUILD_CAPTIONS=ON -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../cef_binary_${CEF_BUILD_VERSION}_linux64" .. diff --git a/CI/install-dependencies-linux.sh b/CI/install-dependencies-linux.sh index a30b8c8e8..a84c19153 100755 --- a/CI/install-dependencies-linux.sh +++ b/CI/install-dependencies-linux.sh @@ -54,3 +54,7 @@ sudo apt-get install -y \ libqt5svg5-dev \ swig \ clang-format-8 + +# build cef +wget --quiet --retry-connrefused --waitretry=1 https://cdn-fastly.obsproject.com/downloads/cef_binary_${CEF_BUILD_VERSION}_linux64.tar.bz2 +tar -xjf ./cef_binary_${CEF_BUILD_VERSION}_linux64.tar.bz2 From 0ca8424c66e680d6b24ff17720facdf7e3786a43 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Wed, 19 Feb 2020 21:29:26 -0600 Subject: [PATCH 3/3] UI: Fix compiling error with older QT --- UI/window-basic-main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 0e3c9e964..f194e8acb 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1724,7 +1724,8 @@ void OBSBasic::OBSInit() if (cef) { QAction *action = new QAction(QTStr("Basic.MainMenu." "View.Docks." - "CustomBrowserDocks")); + "CustomBrowserDocks"), + this); ui->viewMenuDocks->insertAction(ui->toggleScenes, action); connect(action, &QAction::triggered, this, &OBSBasic::ManageExtraBrowserDocks);