Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
PlatformInfo.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
4 * SPDX-FileCopyrightText: (C) 2024 Symless Ltd.
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include <QFileInfo>
11#include <QSysInfo>
12
14
15inline bool isWayland()
16{
17 return qEnvironmentVariable("XDG_SESSION_TYPE") == QStringLiteral("wayland");
18}
19
24inline bool isWindows()
25{
26 return QSysInfo::productType() == QStringLiteral("windows");
27}
28
33inline bool isMac()
34{
35 return QSysInfo::productType() == QStringLiteral("macos");
36}
37
42inline bool isFlatpak()
43{
44 return QFileInfo::exists(QStringLiteral("/.flatpak-info"));
45}
46
51inline bool isSnap()
52{
53 return qEnvironmentVariableIsSet("SNAP");
54}
55
60inline bool isSandboxed()
61{
62 return isFlatpak() || isSnap();
63}
64
65} // namespace deskflow::platform
Definition PlatformInfo.h:13
bool isSandboxed()
isSandboxed
Definition PlatformInfo.h:60
bool isSnap()
isSnap
Definition PlatformInfo.h:51
bool isWayland()
Definition PlatformInfo.h:15
bool isWindows()
isWindows
Definition PlatformInfo.h:24
bool isMac()
isMac
Definition PlatformInfo.h:33
bool isFlatpak()
isFlatpak
Definition PlatformInfo.h:42