diff --git a/klipper/klipper.cpp b/klipper/klipper.cpp --- a/klipper/klipper.cpp +++ b/klipper/klipper.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include "configdialog.h" #include "klippersettings.h" @@ -630,7 +631,7 @@ // selected when Klipper asked first. // Use XQueryPointer rather than QApplication::mouseButtons()/keyboardModifiers(), because // Klipper needs the very current state. - if (!QX11Info::isPlatformX11()) { + if (!KWindowSystem::isPlatformX11()) { return false; } xcb_connection_t *c = QX11Info::connection(); @@ -857,7 +858,7 @@ void Klipper::updateTimestamp() { #if HAVE_X11 - if (QX11Info::isPlatformX11()) { + if (KWindowSystem::isPlatformX11()) { QX11Info::setAppTime(QX11Info::getTimestamp()); } #endif diff --git a/krunner/view.cpp b/krunner/view.cpp --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -142,7 +142,7 @@ void View::initWayland() { - if (!QGuiApplication::platformName().startsWith(QLatin1String("wayland"))) { + if (!KWindowSystem::isPlatformWayland()) { return; } using namespace KWayland::Client; diff --git a/ksplash/ksplashqml/splashapp.cpp b/ksplash/ksplashqml/splashapp.cpp --- a/ksplash/ksplashqml/splashapp.cpp +++ b/ksplash/ksplashqml/splashapp.cpp @@ -72,7 +72,7 @@ setStage(QStringLiteral("initial")); - if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + if (KWindowSystem::isPlatformWayland()) { setStage(QStringLiteral("wm")); } diff --git a/libtaskmanager/launchertasksmodel.cpp b/libtaskmanager/launchertasksmodel.cpp --- a/libtaskmanager/launchertasksmodel.cpp +++ b/libtaskmanager/launchertasksmodel.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -288,7 +289,7 @@ quint32 timeStamp = 0; #if HAVE_X11 - if (QX11Info::isPlatformX11()) { + if (KWindowSystem::isPlatformX11()) { timeStamp = QX11Info::appUserTime(); } #endif diff --git a/libtaskmanager/tasksmodel.cpp b/libtaskmanager/tasksmodel.cpp --- a/libtaskmanager/tasksmodel.cpp +++ b/libtaskmanager/tasksmodel.cpp @@ -162,12 +162,12 @@ // -> flattenGroupsProxyModel (optionally, if groupInline == true) flattens groups out. // -> TasksModel collapses (top-level) items into task lifecycle abstraction; sorts. - if (!windowTasksModel && QGuiApplication::platformName().startsWith(QLatin1String("wayland"))) { + if (!windowTasksModel && KWindowSystem::isPlatformWayland()) { windowTasksModel = new WaylandTasksModel(); } #if HAVE_X11 - if (!windowTasksModel && QX11Info::isPlatformX11()) { + if (!windowTasksModel && KWindowSystem::isPlatformX11()) { windowTasksModel = new XWindowTasksModel(); } #endif diff --git a/libtaskmanager/waylandtasksmodel.cpp b/libtaskmanager/waylandtasksmodel.cpp --- a/libtaskmanager/waylandtasksmodel.cpp +++ b/libtaskmanager/waylandtasksmodel.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,7 @@ void WaylandTasksModel::Private::initWayland() { - if (!QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + if (!KWindowSystem::isPlatformWayland()) { return; } diff --git a/shell/panelshadows.cpp b/shell/panelshadows.cpp --- a/shell/panelshadows.cpp +++ b/shell/panelshadows.cpp @@ -23,6 +23,7 @@ #include +#include #if HAVE_X11 #include #include @@ -47,7 +48,7 @@ #if HAVE_X11 ,_connection( 0x0 ), _gc( 0x0 ) - , m_isX11(QX11Info::isPlatformX11()) + , m_isX11(KWindowSystem::isPlatformX11()) #endif { setupWaylandIntegration(); @@ -680,7 +681,7 @@ void PanelShadows::Private::setupWaylandIntegration() { - if (!QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + if (!KWindowSystem::isPlatformWayland()) { return; } using namespace KWayland::Client; diff --git a/shell/panelview.cpp b/shell/panelview.cpp --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -567,7 +567,7 @@ void PanelView::setAutoHideEnabled(bool enabled) { #if HAVE_X11 - if (QX11Info::isPlatformX11()) { + if (KWindowSystem::isPlatformX11()) { xcb_connection_t *c = QX11Info::connection(); const QByteArray effectName = QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"); diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -217,8 +217,7 @@ watched->inherits("PlasmaQuick::Dialog")) { QPlatformSurfaceEvent *se = static_cast(event); if (se->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { - if (QGuiApplication::platformName().startsWith( - QLatin1String("wayland"), Qt::CaseInsensitive)) { + if (KWindowSystem::isPlatformWayland()) { WaylandDialogFilter::install(qobject_cast(watched), this); } } @@ -1581,7 +1580,7 @@ void ShellCorona::setupWaylandIntegration() { - if (!QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + if (!KWindowSystem::isPlatformWayland()) { return; } using namespace KWayland::Client; diff --git a/xembed-sni-proxy/main.cpp b/xembed-sni-proxy/main.cpp --- a/xembed-sni-proxy/main.cpp +++ b/xembed-sni-proxy/main.cpp @@ -29,6 +29,8 @@ #include +#include + namespace Xcb { Xcb::Atoms* atoms; } @@ -41,7 +43,7 @@ QGuiApplication app(argc, argv); - if (app.platformName() != QLatin1String("xcb")) { + if (!KWindowSystem::isPlatformX11()) { qFatal("xembed-sni-proxy is only useful XCB. Aborting"); }