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
16namespace deskflow::platform {
17
23inline 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
Definition PlatformInfo.h:13
bool isSandboxed()
isSandboxed
Definition PlatformInfo.h:60
void setAppId()
setAppId Set the app id for the xdg portal registry All Applications should do this before attempting...
Definition XDGPortalRegistry.h:23