Deskflow
1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
XDGPortalRegistry.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
4
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
5
*/
6
7
#pragma once
8
9
#include <QDBusConnection>
10
#include <QDBusInterface>
11
#include <QDBusReply>
12
13
#include "common/Constants.h"
14
#include "
common/PlatformInfo.h
"
15
16
namespace
deskflow::platform
{
17
23
inline
void
setAppId
()
24
{
25
// Sandboxed applications are unable to use this portal
26
if
(
isSandboxed
()) {
27
return
;
28
}
29
auto
i =
new
QDBusInterface(
30
"org.freedesktop.portal.Desktop"
,
"/org/freedesktop/portal/desktop"
,
"org.freedesktop.host.portal.Registry"
,
31
QDBusConnection::sessionBus(),
nullptr
32
);
33
34
if
(!i->property(
"version"
).toInt()) {
35
qDebug() <<
"portal registry not found"
;
36
return
;
37
}
38
39
std::ignore = i->call(
"Register"
, kRevFqdnName, QVariantMap{});
40
}
41
42
}
// namespace deskflow::platform
PlatformInfo.h
deskflow::platform
Definition
PlatformInfo.h:13
deskflow::platform::isSandboxed
bool isSandboxed()
isSandboxed
Definition
PlatformInfo.h:60
deskflow::platform::setAppId
void setAppId()
setAppId Set the app id for the xdg portal registry All Applications should do this before attempting...
Definition
XDGPortalRegistry.h:23
src
lib
platform
XDGPortalRegistry.h
Generated by
1.15.0