/* SPDX-FileCopyrightText: 2023 Fushan Wen SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include #include #include using namespace Qt::StringLiterals; namespace X11Info { [[nodiscard]] inline bool isPlatformX11() { return QGuiApplication::platformName() == "xcb"_L1; } [[nodiscard]] inline auto display() { return qGuiApp->nativeInterface()->display(); } [[nodiscard]] inline auto connection() { return qGuiApp->nativeInterface()->connection(); } [[nodiscard]] inline Window appRootWindow() { return DefaultRootWindow(display()); } }