mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Update to changes in MPRIS SystemMediaControlsManager backend
And let it use service name provided by flatpak by default
This commit is contained in:
parent
9726b3c298
commit
afaad155a0
1 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/text/format_song_document_name.h"
|
#include "ui/text/format_song_document_name.h"
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
|
|
||||||
|
#include <ksandbox.h>
|
||||||
|
|
||||||
namespace Media {
|
namespace Media {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -51,7 +53,10 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
||||||
base::Platform::SystemMediaControls::PlaybackStatus;
|
base::Platform::SystemMediaControls::PlaybackStatus;
|
||||||
using Command = base::Platform::SystemMediaControls::Command;
|
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());
|
_controls->setApplicationName(AppName.utf16());
|
||||||
const auto inited = _controls->init(controller->widget());
|
const auto inited = _controls->init(controller->widget());
|
||||||
if (!inited) {
|
if (!inited) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue