Update to changes in MPRIS SystemMediaControlsManager backend

And let it use service name provided by flatpak by default
This commit is contained in:
Ilya Fedin 2022-11-11 03:18:03 +04:00 committed by John Preston
parent 9726b3c298
commit afaad155a0
1 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/format_song_document_name.h"
#include "window/window_controller.h"
#include <ksandbox.h>
namespace Media {
namespace {
@ -51,7 +53,10 @@ SystemMediaControlsManager::SystemMediaControlsManager(
base::Platform::SystemMediaControls::PlaybackStatus;
using Command = base::Platform::SystemMediaControls::Command;
_controls->setServiceName(qsl("org.mpris.MediaPlayer2.tdesktop"));
// Flatpak provides default permission to MPRIS, but not snap
if (!KSandbox::isFlatpak()) {
_controls->setServiceName(qsl("tdesktop"));
}
_controls->setApplicationName(AppName.utf16());
const auto inited = _controls->init(controller->widget());
if (!inited) {