From 652dfc9d6478faa253547f1bc09d35ac935c0ae0 Mon Sep 17 00:00:00 2001 From: Ilya Zlobintsev Date: Sat, 7 Jun 2025 12:21:50 +0300 Subject: [PATCH] fix: add support for automatic streamer mode check from flatpak (#6250) Co-authored-by: nerix --- CHANGELOG.md | 1 + src/singletons/StreamerMode.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ed73aaa..403eee2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Minor: The JSON selector in the upload response can now query arrays using their indices like `foo.0`. (#6193) - Minor: Made nicknames searchable in the Settings dialog search bar. (#5886) - Minor: Added hotkey Action for opening account selector. (#6192) +- Bugfix: Automatic streamer mode detection now works from Flatpak. (#6250) - Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116) - Bugfix: Fixed scrolling now working on inputs in the settings. (#6128) - Bugfix: Make reply-cancel button less coarse-grained. (#6106) diff --git a/src/singletons/StreamerMode.cpp b/src/singletons/StreamerMode.cpp index 41c3661c..62ec50dd 100644 --- a/src/singletons/StreamerMode.cpp +++ b/src/singletons/StreamerMode.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "common/Literals.hpp" #include "common/QLogging.hpp" +#include "common/Version.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "singletons/Settings.hpp" #include "util/PostToThread.hpp" @@ -55,8 +56,17 @@ bool isBroadcasterSoftwareActive() static bool shouldShowWarning = true; QProcess p; - p.start("pgrep", {"-xi", broadcastingBinaries().join("|")}, - QIODevice::NotOpen); + if (Version::instance().isFlatpak()) + { + p.start("flatpak-spawn", + {"--host", "pgrep", "-xi", broadcastingBinaries().join("|")}, + QIODevice::NotOpen); + } + else + { + p.start("pgrep", {"-xi", broadcastingBinaries().join("|")}, + QIODevice::NotOpen); + } if (p.waitForFinished(1000) && p.exitStatus() == QProcess::NormalExit) {