Skip to content

Commit

Permalink
UI/importers: Translate capture sources depending on WS
Browse files Browse the repository at this point in the history
Translate window or game capture sources to xcomposite or pipewire
depending on the window system used.
This change prevents xcomposite being assigned on non-X11 systems
which causes a crash
  • Loading branch information
SarenDev authored and RytoEX committed Oct 30, 2024
1 parent ab48cd0 commit 23e772c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion UI/importers/studio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
******************************************************************************/

#include "importers.hpp"
#if !defined(_WIN32) && !defined(__APPLE__)
#include <obs-nix-platform.h>
#endif

using namespace std;
using namespace json11;
Expand Down Expand Up @@ -109,7 +112,13 @@ void TranslateOSStudio(Json &res)
ClearTranslation("av_capture_input", "v4l2_input");
ClearTranslation("dshow_input", "v4l2_input");

ClearTranslation("window_capture", "xcomposite_input");
if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_EGL) {
ClearTranslation("game_capture", "xcomposite_input");
ClearTranslation("window_capture", "xcomposite_input");
} else {
ClearTranslation("game_capture", "pipewire-screen-capture-source");
ClearTranslation("window_capture", "pipewire-screen-capture-source");
}

if (id == "monitor_capture") {
source["id"] = "xshm_input";
Expand Down

0 comments on commit 23e772c

Please sign in to comment.