File no-x11-ewe.patch of Package plasma-workspace

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28729ce167..2c44c8c138 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,7 +128,6 @@ set_package_properties(QALCULATE PROPERTIES
 pkg_check_modules(DBus dbus-1 REQUIRED IMPORTED_TARGET)
 
 find_package(KWinDBusInterface CONFIG REQUIRED)
-find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
 
 # Used in kcm_autostart
 pkg_check_modules(SYSTEMD "systemd")
@@ -458,8 +457,6 @@ if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
 add_subdirectory(solidautoeject)
 endif()
 
-ecm_optional_add_subdirectory(xembed-sni-proxy)
-
 if (WITH_X11)
     #TODO port away from X11
     ecm_optional_add_subdirectory(gmenu-dbusmenu-proxy)
diff --git a/applets/kicker/dashboardwindow.cpp b/applets/kicker/dashboardwindow.cpp
index 69f30e059d..cfb106a2f5 100644
--- a/applets/kicker/dashboardwindow.cpp
+++ b/applets/kicker/dashboardwindow.cpp
@@ -12,7 +12,6 @@
 
 #include <KWindowEffects>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include <PlasmaQuick/PlasmaShellWaylandIntegration>
 
@@ -119,9 +118,6 @@ void DashboardWindow::toggle()
         close();
     } else {
         showFullScreen();
-        if (KWindowSystem::isPlatformX11()) {
-            KX11Extras::forceActiveWindow(winId());
-        }
     }
 }
 
@@ -131,9 +127,6 @@ bool DashboardWindow::event(QEvent *event)
         const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event);
 
         if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
-            if (KWindowSystem::isPlatformX11()) {
-                KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
-            }
         }
     } else if (event->type() == QEvent::Show) {
         updateTheme();
@@ -145,8 +138,6 @@ bool DashboardWindow::event(QEvent *event)
         if (m_mainItem) {
             m_mainItem->setVisible(false);
         }
-    } else if (event->type() == QEvent::FocusOut && KWindowSystem::isPlatformX11() && isVisible()) {
-        KX11Extras::forceActiveWindow(winId());
     }
 
     return QQuickWindow::event(event);
diff --git a/applets/kicker/windowsystem.cpp b/applets/kicker/windowsystem.cpp
index 30f5c7e95e..14332225eb 100644
--- a/applets/kicker/windowsystem.cpp
+++ b/applets/kicker/windowsystem.cpp
@@ -9,7 +9,6 @@
 #include <QQuickItem>
 
 #include <KWindowSystem>
-#include <KX11Extras>
 
 WindowSystem::WindowSystem(QObject *parent)
     : QObject(parent)
@@ -33,9 +32,6 @@ bool WindowSystem::eventFilter(QObject *watched, QEvent *event)
 void WindowSystem::forceActive(QQuickItem *item)
 {
     if (item) {
-        if (auto window = item->window(); KWindowSystem::isPlatformX11() && window) {
-            KX11Extras::forceActiveWindow(window->winId());
-        }
     }
 }
 
diff --git a/applets/notifications/notificationapplet.cpp b/applets/notifications/notificationapplet.cpp
index f0b5407e7e..1e0dc49ff9 100644
--- a/applets/notifications/notificationapplet.cpp
+++ b/applets/notifications/notificationapplet.cpp
@@ -13,8 +13,6 @@
 #include <QQuickWindow>
 #include <QScreen>
 
-#include <KX11Extras>
-
 #include <Plasma/Containment>
 #include <PlasmaQuick/AppletQuickItem>
 #include <PlasmaQuick/Dialog>
@@ -96,9 +94,6 @@ bool NotificationApplet::isPrimaryScreen(const QRect &rect) const
 
 void NotificationApplet::forceActivateWindow(QWindow *window)
 {
-    if (window && window->winId()) {
-        KX11Extras::forceActiveWindow(window->winId());
-    }
 }
 
 K_PLUGIN_CLASS_WITH_JSON(NotificationApplet, "metadata.json")
diff --git a/applets/notifications/notificationwindow.cpp b/applets/notifications/notificationwindow.cpp
index 598c6f71be..7963c90183 100644
--- a/applets/notifications/notificationwindow.cpp
+++ b/applets/notifications/notificationwindow.cpp
@@ -6,7 +6,6 @@
 #include "notificationwindow.h"
 
 #include <KWindowSystem>
-#include <KX11Extras>
 #include <PlasmaQuick/PlasmaShellWaylandIntegration>
 
 NotificationWindow::NotificationWindow()
@@ -14,11 +13,6 @@ NotificationWindow::NotificationWindow()
 {
     PlasmaShellWaylandIntegration::get(this)->setRole(QtWayland::org_kde_plasma_surface::role_notification);
     PlasmaShellWaylandIntegration::get(this)->setTakesFocus(false);
-
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::setOnAllDesktops(winId(), true);
-        KX11Extras::setType(winId(), NET::Notification);
-    }
 }
 
 NotificationWindow::~NotificationWindow()
@@ -58,10 +52,6 @@ void NotificationWindow::setIsCritical(bool critical)
     auto role = critical ? QtWayland::org_kde_plasma_surface::role_criticalnotification : QtWayland::org_kde_plasma_surface::role_notification;
     PlasmaShellWaylandIntegration::get(this)->setRole(role);
 
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::setType(winId(), critical ? NET::CriticalNotification : NET::Notification);
-    }
-
     Q_EMIT isCriticalChanged();
 }
 
diff --git a/appmenu/appmenu.h b/appmenu/appmenu.h
index f4234dcac6..68bcc6e05f 100644
--- a/appmenu/appmenu.h
+++ b/appmenu/appmenu.h
@@ -9,7 +9,7 @@
 #pragma once
 
 #include <config-X11.h>
-#ifdef HAVE_X11
+#if HAVE_X11
 #include <xcb/xcb.h>
 #endif
 
@@ -86,7 +86,7 @@ private:
     QDBusServiceWatcher *m_menuViewWatcher;
     QPointer<VerticalMenu> m_menu;
 
-#ifdef HAVE_X11
+#if HAVE_X11
     xcb_connection_t *m_xcbConn = nullptr;
 #endif
     KWayland::Client::PlasmaShell *m_plasmashell = nullptr;
diff --git a/appmenu/menuimporter.cpp b/appmenu/menuimporter.cpp
index 87d8d8ca21..ed378dde4c 100644
--- a/appmenu/menuimporter.cpp
+++ b/appmenu/menuimporter.cpp
@@ -13,7 +13,6 @@
 #include <QDBusMessage>
 #include <QDBusServiceWatcher>
 
-#include <KWindowInfo>
 #include <KWindowSystem>
 
 static constexpr QLatin1StringView DBUS_SERVICE("com.canonical.AppMenu.Registrar");
@@ -50,18 +49,6 @@ void MenuImporter::RegisterWindow(WId id, const QDBusObjectPath &path)
     if (path.path().isEmpty()) // prevent bad dbusmenu usage
         return;
 
-    if (KWindowSystem::isPlatformX11()) {
-        KWindowInfo info(id, NET::WMWindowType, NET::WM2WindowClass);
-        NET::WindowTypes mask = NET::AllTypesMask;
-        auto type = info.windowType(mask);
-
-        // Menu can try to register, right click in gimp for example
-        if (type != NET::Unknown && (type & (NET::Menu | NET::DropdownMenu | NET::PopupMenu))) {
-            return;
-        }
-        m_windowClasses.insert(id, QString::fromLocal8Bit(info.windowClassClass()));
-    }
-
     QString service = message().service();
 
     m_menuServices.insert(id, service);
diff --git a/components/sessionsprivate/CMakeLists.txt b/components/sessionsprivate/CMakeLists.txt
index dec965b580..8130794e41 100644
--- a/components/sessionsprivate/CMakeLists.txt
+++ b/components/sessionsprivate/CMakeLists.txt
@@ -3,8 +3,6 @@ set(sessionsprivateplugin_SRCS
     types.h
 )
 
-qt_add_dbus_interface(sessionsprivateplugin_SRCS ${SCREENSAVER_DBUS_INTERFACE} screensaver_interface)
-
 kconfig_add_kcfg_files(sessionsprivateplugin_SRCS kscreensaversettings.kcfgc)
 
 ecm_add_qml_module(sessionsprivateplugin
diff --git a/components/sessionsprivate/sessionsmodel.cpp b/components/sessionsprivate/sessionsmodel.cpp
index 20bda2b6c1..5e0f08c4b4 100644
--- a/components/sessionsprivate/sessionsmodel.cpp
+++ b/components/sessionsprivate/sessionsmodel.cpp
@@ -14,284 +14,4 @@
 
 #include "kscreensaversettings.h"
 
-#include "screensaver_interface.h"
-
-SessionsModel::SessionsModel(QObject *parent)
-    : QAbstractListModel(parent)
-    , m_screensaverInterface(
-          new org::freedesktop::ScreenSaver(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/ScreenSaver"), QDBusConnection::sessionBus(), this))
-{
-    reload();
-
-    // wait for the screen locker to be ready before actually switching
-    connect(m_screensaverInterface, &org::freedesktop::ScreenSaver::ActiveChanged, this, [this](bool active) {
-        if (active) {
-            if (m_pendingVt) {
-                m_displayManager.switchVT(m_pendingVt);
-                Q_EMIT switchedUser(m_pendingVt);
-            } else if (m_pendingReserve) {
-                m_displayManager.startReserve();
-                Q_EMIT startedNewSession();
-            }
-
-            m_pendingVt = 0;
-            m_pendingReserve = false;
-        }
-    });
-}
-
-bool SessionsModel::canSwitchUser() const
-{
-    return const_cast<SessionsModel *>(this)->m_displayManager.isSwitchable() && KAuthorized::authorizeAction(QStringLiteral("switch_user"));
-}
-
-bool SessionsModel::canStartNewSession() const
-{
-    return const_cast<SessionsModel *>(this)->m_displayManager.numReserve() > 0 && KAuthorized::authorizeAction(QStringLiteral("start_new_session"));
-}
-
-bool SessionsModel::shouldLock() const
-{
-    return m_shouldLock;
-}
-
-bool SessionsModel::includeUnusedSessions() const
-{
-    return m_includeUnusedSessions;
-}
-
-void SessionsModel::setIncludeUnusedSessions(bool includeUnusedSessions)
-{
-    if (m_includeUnusedSessions != includeUnusedSessions) {
-        m_includeUnusedSessions = includeUnusedSessions;
-
-        reload();
-
-        Q_EMIT includeUnusedSessionsChanged();
-    }
-}
-
-void SessionsModel::switchUser(int vt, bool shouldLock)
-{
-    if (vt < 0) {
-        startNewSession(shouldLock);
-        return;
-    }
-
-    if (!canSwitchUser()) {
-        return;
-    }
-
-    if (!shouldLock) {
-        m_displayManager.switchVT(vt);
-        Q_EMIT switchedUser(vt);
-        return;
-    }
-
-    checkScreenLocked([this, vt](bool locked) {
-        if (locked) {
-            // already locked, switch right away
-            m_displayManager.switchVT(vt);
-            Q_EMIT switchedUser(vt);
-        } else {
-            m_pendingReserve = false;
-            m_pendingVt = vt;
-
-            Q_EMIT aboutToLockScreen();
-            m_screensaverInterface->Lock();
-        }
-    });
-}
-
-void SessionsModel::startNewSession(bool shouldLock)
-{
-    if (!canStartNewSession()) {
-        return;
-    }
-
-    if (!shouldLock) {
-        m_displayManager.startReserve();
-        Q_EMIT startedNewSession();
-        return;
-    }
-
-    checkScreenLocked([this](bool locked) {
-        if (locked) {
-            // already locked, switch right away
-            m_displayManager.startReserve();
-            Q_EMIT startedNewSession();
-        } else {
-            m_pendingReserve = true;
-            m_pendingVt = 0;
-
-            Q_EMIT aboutToLockScreen();
-            m_screensaverInterface->Lock();
-        }
-    });
-}
-
-void SessionsModel::reload()
-{
-    static QHash<QString, KUser> kusers;
-
-    const bool oldShouldLock = m_shouldLock;
-    m_shouldLock = KAuthorized::authorizeAction(QStringLiteral("lock_screen")) && KScreenSaverSettings::autolock();
-    if (m_shouldLock != oldShouldLock) {
-        Q_EMIT shouldLockChanged();
-    }
-
-    SessList sessions;
-    m_displayManager.localSessions(sessions);
-
-    const int oldCount = m_data.count();
-
-    beginResetModel();
-
-    m_data.clear();
-    m_data.reserve(sessions.count());
-
-    for (const SessEnt &session : std::as_const(sessions)) {
-        if (!session.vt || session.self) {
-            continue;
-        }
-
-        if (!m_includeUnusedSessions && session.session.isEmpty()) {
-            continue;
-        }
-
-        SessionEntry entry;
-        entry.name = session.user;
-        entry.displayNumber = session.display;
-        entry.vtNumber = session.vt;
-        entry.session = session.session;
-        entry.isTty = session.tty;
-
-        auto it = kusers.constFind(session.user);
-        if (it != kusers.constEnd()) {
-            entry.realName = it->property(KUser::FullName).toString();
-            entry.icon = it->faceIconPath();
-        } else {
-            KUser user(session.user);
-            entry.realName = user.property(KUser::FullName).toString();
-            entry.icon = user.faceIconPath();
-            kusers.insert(session.user, user);
-        }
-
-        m_data.append(entry);
-    }
-
-    endResetModel();
-
-    if (oldCount != m_data.count()) {
-        Q_EMIT countChanged();
-    }
-}
-
-void SessionsModel::checkScreenLocked(std::function<void(bool)> &&cb)
-{
-    auto reply = m_screensaverInterface->GetActive();
-    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
-    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [cb = std::move(cb)](QDBusPendingCallWatcher *watcher) {
-        QDBusPendingReply<bool> reply = *watcher;
-        if (!reply.isError()) {
-            cb(reply.value());
-        }
-        watcher->deleteLater();
-    });
-}
-
-void SessionsModel::setShowNewSessionEntry(bool showNewSessionEntry)
-{
-    if (!canStartNewSession()) {
-        return;
-    }
-
-    if (showNewSessionEntry == m_showNewSessionEntry) {
-        return;
-    }
-
-    int row = m_data.size();
-    if (showNewSessionEntry) {
-        beginInsertRows(QModelIndex(), row, row);
-        m_showNewSessionEntry = showNewSessionEntry;
-        endInsertRows();
-    } else {
-        beginRemoveRows(QModelIndex(), row, row);
-        m_showNewSessionEntry = showNewSessionEntry;
-        endRemoveRows();
-    }
-    Q_EMIT countChanged();
-}
-
-QVariant SessionsModel::data(const QModelIndex &index, int role) const
-{
-    if (index.row() < 0 || index.row() > rowCount(QModelIndex())) {
-        return QVariant();
-    }
-
-    if (index.row() == m_data.count()) {
-        switch (role) {
-        case RealNameRole:
-            return i18n("New Session");
-        case IconNameRole:
-            return QStringLiteral("system-switch-user");
-        case NameRole:
-            return i18n("New Session");
-        case DisplayNumberRole:
-            return 0; // NA
-        case VtNumberRole:
-            return -1; // an invalid VtNumber - which we'll use to indicate it's to start a new session
-        case SessionRole:
-            return 0; // NA
-        case IsTtyRole:
-            return false; // NA
-        default:
-            return QVariant();
-        }
-    }
-
-    const SessionEntry &item = m_data.at(index.row());
-
-    switch (role) {
-    case RealNameRole:
-        return item.realName;
-    case IconRole:
-        return item.icon;
-    case NameRole:
-        return item.name;
-    case DisplayNumberRole:
-        return item.displayNumber;
-    case VtNumberRole:
-        return item.vtNumber;
-    case SessionRole:
-        return item.session;
-    case IsTtyRole:
-        return item.isTty;
-    default:
-        return QVariant();
-    }
-}
-
-int SessionsModel::rowCount(const QModelIndex &parent) const
-{
-    Q_UNUSED(parent);
-    return m_data.count() + (m_showNewSessionEntry ? 1 : 0);
-}
-
-QHash<int, QByteArray> SessionsModel::roleNames() const
-{
-    QHash<int, QByteArray> roleNames;
-
-    roleNames[NameRole] = QByteArrayLiteral("name");
-    roleNames[RealNameRole] = QByteArrayLiteral("realName");
-    roleNames[IconRole] = QByteArrayLiteral("icon");
-    roleNames[IconNameRole] = QByteArrayLiteral("iconName");
-    roleNames[DisplayNumberRole] = QByteArrayLiteral("displayNumber");
-    roleNames[VtNumberRole] = QByteArrayLiteral("vtNumber");
-    roleNames[SessionRole] = QByteArrayLiteral("session");
-    roleNames[IsTtyRole] = QByteArrayLiteral("isTty");
-
-    return roleNames;
-}
-
 #include "moc_sessionsmodel.cpp"
diff --git a/components/sessionsprivate/sessionsmodel.h b/components/sessionsprivate/sessionsmodel.h
index bc580d7406..bbb1fff958 100644
--- a/components/sessionsprivate/sessionsmodel.h
+++ b/components/sessionsprivate/sessionsmodel.h
@@ -13,15 +13,6 @@
 
 #include <functional>
 
-class OrgFreedesktopScreenSaverInterface;
-namespace org
-{
-namespace freedesktop
-{
-using ScreenSaver = ::OrgFreedesktopScreenSaverInterface;
-}
-}
-
 struct SessionEntry {
     QString realName;
     QString icon;
@@ -34,76 +25,3 @@ struct SessionEntry {
 
 class KDisplayManager;
 
-// This model should be compatible with SDDM::SessionModel
-class SessionsModel : public QAbstractListModel
-{
-    Q_OBJECT
-    QML_ELEMENT
-
-    Q_PROPERTY(bool canSwitchUser READ canSwitchUser CONSTANT)
-    Q_PROPERTY(bool canStartNewSession READ canStartNewSession CONSTANT)
-    Q_PROPERTY(bool shouldLock READ shouldLock NOTIFY shouldLockChanged)
-    Q_PROPERTY(bool showNewSessionEntry MEMBER m_showNewSessionEntry WRITE setShowNewSessionEntry NOTIFY showNewSessionEntryChanged)
-    Q_PROPERTY(bool includeUnusedSessions READ includeUnusedSessions WRITE setIncludeUnusedSessions NOTIFY includeUnusedSessionsChanged)
-
-    Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
-
-public:
-    explicit SessionsModel(QObject *parent = nullptr);
-    ~SessionsModel() override = default;
-
-    enum UserRoles {
-        NameRole = Qt::UserRole + 1,
-        RealNameRole,
-        IconRole, // path to a file
-        IconNameRole, // name of an icon
-        DisplayNumberRole,
-        VtNumberRole,
-        SessionRole,
-        IsTtyRole,
-    };
-    Q_ENUM(UserRoles)
-
-    bool canSwitchUser() const;
-    bool canStartNewSession() const;
-    bool shouldLock() const;
-    bool includeUnusedSessions() const;
-
-    void setShowNewSessionEntry(bool showNewSessionEntry);
-    void setIncludeUnusedSessions(bool includeUnusedSessions);
-
-    Q_INVOKABLE void reload();
-    Q_INVOKABLE void switchUser(int vt, bool shouldLock = false);
-    Q_INVOKABLE void startNewSession(bool shouldLock = false);
-
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
-    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
-    QHash<int, QByteArray> roleNames() const override;
-
-Q_SIGNALS:
-    void shouldLockChanged();
-    void showNewSessionEntryChanged();
-    void countChanged();
-    void includeUnusedSessionsChanged();
-
-    void switchedUser(int vt);
-    void startedNewSession();
-    void aboutToLockScreen();
-
-private:
-    void checkScreenLocked(std::function<void(bool)> &&cb);
-
-    KDisplayManager m_displayManager;
-
-    QList<SessionEntry> m_data;
-
-    bool m_shouldLock = true;
-
-    int m_pendingVt = 0;
-    bool m_pendingReserve = false;
-
-    bool m_showNewSessionEntry = false;
-    bool m_includeUnusedSessions = true;
-
-    org::freedesktop::ScreenSaver *m_screensaverInterface = nullptr;
-};
diff --git a/containmentactions/contextmenu/CMakeLists.txt b/containmentactions/contextmenu/CMakeLists.txt
index 751032f5bd..fe46038cb0 100644
--- a/containmentactions/contextmenu/CMakeLists.txt
+++ b/containmentactions/contextmenu/CMakeLists.txt
@@ -10,8 +10,6 @@ set(contextmenu_SRCS
 set(krunner_xml ${plasma-workspace_SOURCE_DIR}/krunner/dbus/org.kde.krunner.App.xml)
 qt_add_dbus_interface(contextmenu_SRCS ${krunner_xml} krunner_interface)
 
-qt_add_dbus_interface(contextmenu_SRCS ${SCREENSAVER_DBUS_INTERFACE} screensaver_interface)
-
 kcoreaddons_add_plugin(plasma_containmentactions_contextmenu SOURCES ${contextmenu_SRCS} INSTALL_NAMESPACE "plasma/containmentactions")
 
 set_target_properties(plasma_containmentactions_contextmenu PROPERTIES
diff --git a/kcms/colors/CMakeLists.txt b/kcms/colors/CMakeLists.txt
index 1a55c53c22..ef3347cffc 100644
--- a/kcms/colors/CMakeLists.txt
+++ b/kcms/colors/CMakeLists.txt
@@ -72,7 +72,6 @@ target_link_libraries(plasma-apply-colorscheme
     KF6::DBusAddons
     KF6::ColorScheme
     PW::KWorkspace
-    X11::X11
     krdb
 )
 
@@ -98,7 +97,6 @@ target_link_libraries(plasma_accentcolor_service
     KF6::DBusAddons
     KF6::ColorScheme
     PW::KWorkspace
-    X11::X11
     krdb
 )
 
diff --git a/kcms/krdb/CMakeLists.txt b/kcms/krdb/CMakeLists.txt
index ecb65e8c99..474907f650 100644
--- a/kcms/krdb/CMakeLists.txt
+++ b/kcms/krdb/CMakeLists.txt
@@ -6,7 +6,7 @@ generate_export_header(krdb)
 
 target_include_directories(krdb PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/krdb>")
 
-target_link_libraries(krdb PRIVATE Qt::Widgets Qt::DBus KF6::CoreAddons KF6::DBusAddons KF6::GuiAddons KF6::I18n KF6::WindowSystem KF6::ColorScheme X11::X11 Qt::GuiPrivate)
+target_link_libraries(krdb PRIVATE Qt::Widgets Qt::DBus KF6::CoreAddons KF6::DBusAddons KF6::GuiAddons KF6::I18n KF6::WindowSystem KF6::ColorScheme Qt::GuiPrivate)
 
 if(HAVE_X11)
   target_link_libraries(krdb PRIVATE XCB::XCB XCB::CURSOR)
diff --git a/klipper/klipperpopup.cpp b/klipper/klipperpopup.cpp
index a147d68f8a..83f76d87ad 100644
--- a/klipper/klipperpopup.cpp
+++ b/klipper/klipperpopup.cpp
@@ -18,7 +18,6 @@
 #include <KWayland/Client/plasmashell.h>
 #include <KWayland/Client/surface.h>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include "historymodel.h"
 #include "klipper.h"
@@ -79,43 +78,19 @@ void KlipperPopup::resizePopup()
     // If the popup is off-screen, move it to the closest edge of the screen
     const QSize popupSize = QSize(mainItem()->implicitWidth(), mainItem()->implicitHeight()).grownBy(padding()).boundedTo(screen()->availableSize());
 
-    if (KWindowSystem::isPlatformX11()) {
-        const QRect screenGeometry = screen()->geometry();
-        QRect popupGeometry(position(), popupSize);
-        if (!screenGeometry.contains(popupGeometry)) {
-            popupGeometry.moveTo(std::clamp(x(), screenGeometry.left(), screenGeometry.right() - popupSize.width()),
-                                 std::clamp(y(), screenGeometry.top(), screenGeometry.bottom() - popupSize.height()));
-        }
-        setGeometry(popupGeometry);
-    } else {
         resize(popupSize);
-    }
 }
 
 void KlipperPopup::showEvent(QShowEvent *event)
 {
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::setOnAllDesktops(winId(), true);
-    }
     PlasmaWindow::showEvent(event); // NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher
     requestActivate();
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::forceActiveWindow(winId());
-    }
 }
 
 void KlipperPopup::positionOnScreen()
 {
     const QList<QScreen *> screens = QGuiApplication::screens();
-    if (KWindowSystem::isPlatformX11()) {
-        auto screenIt = std::find_if(screens.cbegin(), screens.cend(), [](QScreen *screen) {
-            return screen->geometry().contains(QCursor::pos(screen));
-        });
-        QScreen *const shownOnScreen = screenIt != screens.cend() ? *screenIt : QGuiApplication::primaryScreen();
-        setPosition(QCursor::pos(shownOnScreen));
-        setScreen(shownOnScreen);
-        KX11Extras::setOnDesktop(winId(), KX11Extras::currentDesktop());
-    } else if (m_plasmashell && KWindowSystem::isPlatformWayland()) {
+    if (m_plasmashell && KWindowSystem::isPlatformWayland()) {
         auto surface = KWayland::Client::Surface::fromWindow(this);
         auto plasmaSurface = m_plasmashell->createSurface(surface, this);
         plasmaSurface->openUnderCursor();
diff --git a/klipper/urlgrabber.cpp b/klipper/urlgrabber.cpp
index daa8642cbd..24b735c06f 100644
--- a/klipper/urlgrabber.cpp
+++ b/klipper/urlgrabber.cpp
@@ -5,8 +5,6 @@
 */
 #include "urlgrabber.h"
 
-#include <netwm.h>
-
 #include "klipper_debug.h"
 #include <QFile>
 #include <QIcon>
@@ -22,9 +20,7 @@
 #include <KNotificationJobUiDelegate>
 #include <KService>
 #include <KStringHandler>
-#include <KWindowInfo>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include "clipcommandprocess.h"
 #include "klippersettings.h"
@@ -300,12 +296,7 @@ void URLGrabber::saveSettings() const
 // find out whether the active window's WM_CLASS is in our avoid-list
 bool URLGrabber::isAvoidedWindow() const
 {
-    const WId active = KX11Extras::activeWindow();
-    if (!active) {
         return false;
-    }
-    KWindowInfo info(active, NET::Properties(), NET::WM2WindowClass);
-    return m_myAvoidWindows.contains(QString::fromLatin1(info.windowClassName()));
 }
 
 void URLGrabber::slotKillPopupMenu()
diff --git a/krunner/view.cpp b/krunner/view.cpp
index afefe9ab48..d37b7e0fbd 100644
--- a/krunner/view.cpp
+++ b/krunner/view.cpp
@@ -23,7 +23,6 @@
 #include <KService>
 #include <KWindowEffects>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include <LayerShellQt/Window>
 #include <qnamespace.h>
@@ -41,10 +40,6 @@ View::View(PlasmaQuick::SharedQmlEngine *engine, QWindow *)
     KCrash::initialize();
     qmlRegisterUncreatableType<View>("org.kde.krunner.private.view", 1, 0, "HistoryBehavior", u"Only for enums"_s);
 
-    if (KWindowSystem::isPlatformX11()) {
-        m_x11Positioner = new X11WindowScreenRelativePositioner(this);
-    }
-
     // used only by screen readers
     setTitle(i18n("KRunner"));
 
@@ -154,14 +149,8 @@ void View::loadConfig()
 
 void View::showEvent(QShowEvent *event)
 {
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::setOnAllDesktops(winId(), true);
-    }
     QQuickWindow::showEvent(event);
     requestActivate();
-    if (KWindowSystem::isPlatformX11()) {
-        KX11Extras::forceActiveWindow(winId());
-    }
 }
 
 void View::positionOnScreen()
@@ -177,10 +166,6 @@ void View::positionOnScreen()
                 return screen->name() == activeOutputName;
             });
         }
-    } else if (KWindowSystem::isPlatformX11()) {
-        screenIt = std::find_if(screens.cbegin(), screens.cend(), [](QScreen *screen) {
-            return screen->geometry().contains(QCursor::pos(screen));
-        });
     }
 
     QScreen *const shownOnScreen = screenIt != screens.cend() ? *screenIt : QGuiApplication::primaryScreen();
@@ -194,24 +179,11 @@ void View::positionOnScreen()
         layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityOnDemand);
         layerWindow->setMargins(margins());
         layerWindow->setScreenConfiguration(m_floating ? LayerShellQt::Window::ScreenFromQWindow : LayerShellQt::Window::ScreenFromCompositor);
-    } else if (KWindowSystem::isPlatformX11()) {
-        m_x11Positioner->setAnchors(Qt::TopEdge);
-        m_x11Positioner->setMargins(margins());
-        if (m_floating) {
-            KX11Extras::setOnDesktop(winId(), KX11Extras::currentDesktop());
-        } else {
-            KX11Extras::setOnAllDesktops(winId(), true);
-        }
-        KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
     }
 }
 
 void View::toggleDisplay()
 {
-    if (isVisible() && !QGuiApplication::focusWindow() && KWindowSystem::isPlatformX11()) {
-        KX11Extras::forceActiveWindow(winId());
-        return;
-    }
     if (isVisible()) {
         setVisible(false);
     } else {
diff --git a/libkworkspace/CMakeLists.txt b/libkworkspace/CMakeLists.txt
index 54f2544499..d7a665757d 100644
--- a/libkworkspace/CMakeLists.txt
+++ b/libkworkspace/CMakeLists.txt
@@ -22,7 +22,6 @@ set(kworkspace_LIB_SRCS kdisplaymanager.cpp
 
 add_definitions(-DTRANSLATION_DOMAIN=\"libkworkspace\")
 
-qt_add_dbus_interface(kworkspace_LIB_SRCS ${SCREENSAVER_DBUS_INTERFACE} screenlocker_interface )
 qt_add_dbus_interface(kworkspace_LIB_SRCS ${plasma-workspace_SOURCE_DIR}/ksmserver/org.kde.LogoutPrompt.xml logoutprompt_interface)
 qt_add_dbus_interface(kworkspace_LIB_SRCS ${plasma-workspace_SOURCE_DIR}/startkde/plasma-session/org.kde.Startup.xml startup_interface)
 qt_add_dbus_interface(kworkspace_LIB_SRCS ${plasma-workspace_SOURCE_DIR}/startkde/plasma-shutdown/org.kde.Shutdown.xml shutdown_interface)
diff --git a/libkworkspace/sessionmanagement.cpp b/libkworkspace/sessionmanagement.cpp
index 248147f505..5added9f27 100644
--- a/libkworkspace/sessionmanagement.cpp
+++ b/libkworkspace/sessionmanagement.cpp
@@ -18,7 +18,6 @@
 #include <iostream>
 
 #include "logoutprompt_interface.h"
-#include "screenlocker_interface.h"
 #include "shutdown_interface.h"
 
 #include "libkworkspace_debug.h"
@@ -148,18 +147,11 @@ void SessionManagement::requestLogoutPrompt()
         return;
     }
 
-    OrgFreedesktopScreenSaverInterface ifaceScreenSaver(QStringLiteral("org.freedesktop.ScreenSaver"),
-                                                        QStringLiteral("/ScreenSaver"),
-                                                        QDBusConnection::sessionBus());
-
-    // Do not show Logoup prompt when in the lockscreen / screensaver
-    if (!ifaceScreenSaver.GetActive()) {
         // Don't bother to check for whether the user normally wants confirmation or
         // not; if this function was invoked, it means they do want to see the logout
         // prompt right now
         LogoutPromptIface iface;
         lockQuitUntilFinished(iface.promptAll());
-    }
 }
 
 void SessionManagement::requestShutdown(ConfirmationMode confirmationMode)
@@ -266,8 +258,6 @@ void SessionManagement::lock()
     if (!canLock()) {
         return;
     }
-    OrgFreedesktopScreenSaverInterface iface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/ScreenSaver"), QDBusConnection::sessionBus());
-    iface.Lock();
 }
 
 void SessionManagement::switchUser()
@@ -280,28 +270,6 @@ void SessionManagement::switchUser()
         qCWarning(LIBKWORKSPACE_DEBUG) << "Cannot switch user: XDG_SEAT_PATH not set";
         return;
     }
-
-    // lock first
-    OrgFreedesktopScreenSaverInterface screenSaverIface(QStringLiteral("org.freedesktop.ScreenSaver"),
-                                                        QStringLiteral("/ScreenSaver"),
-                                                        QDBusConnection::sessionBus());
-    QDBusPendingReply<> pendingLock = screenSaverIface.Lock();
-
-    // then tell the display manager to switch
-    auto watcher = new QDBusPendingCallWatcher(pendingLock, this);
-    connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater);
-    connect(watcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher *watcher) {
-        if (watcher->isError()) {
-            qCWarning(LIBKWORKSPACE_DEBUG) << "Failed to lock screen before switching user:" << watcher->error().message();
-            return;
-        }
-        QDBusMessage switchToGreeterMessage = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
-                                                                             qEnvironmentVariable("XDG_SEAT_PATH"),
-                                                                             QStringLiteral("org.freedesktop.DisplayManager.Seat"),
-                                                                             u"SwitchToGreeter"_s);
-
-        QDBusConnection::systemBus().asyncCall(switchToGreeterMessage);
-    });
 }
 
 void SessionManagement::saveSession()
diff --git a/libnotificationmanager/server.cpp b/libnotificationmanager/server.cpp
index 4dc1db9012..865fd567a0 100644
--- a/libnotificationmanager/server.cpp
+++ b/libnotificationmanager/server.cpp
@@ -13,7 +13,6 @@
 
 #include "debug.h"
 
-#include <KStartupInfo>
 #include <KWaylandExtras>
 #include <KWindowSystem>
 #include <QDebug>
@@ -94,16 +93,6 @@ void Server::invokeAction(uint notificationId,
                             }
                         });
         KWaylandExtras::requestXdgActivationToken(window, launchedSerial, xdgActivationAppId);
-    } else {
-        KStartupInfoId startupId;
-        startupId.initId();
-
-        Q_EMIT d->ActivationToken(notificationId, QString::fromUtf8(startupId.id()));
-
-        Q_EMIT d->ActionInvoked(notificationId, actionName);
-        if (behavior & Notifications::Close) {
-            Q_EMIT d->CloseNotification(notificationId);
-        }
     }
 }
 
diff --git a/libtaskmanager/virtualdesktopinfo.cpp b/libtaskmanager/virtualdesktopinfo.cpp
index a510b97cb8..40733e8e48 100644
--- a/libtaskmanager/virtualdesktopinfo.cpp
+++ b/libtaskmanager/virtualdesktopinfo.cpp
@@ -9,7 +9,6 @@
 
 #include <KLocalizedString>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include <qwayland-org-kde-plasma-virtual-desktop.h>
 
@@ -26,14 +25,6 @@
 #include <netwm.h>
 #endif // HAVE_X11
 
-namespace X11Info
-{
-[[nodiscard]] inline auto connection()
-{
-    return qGuiApp->nativeInterface<QNativeInterface::QX11Application>()->connection();
-}
-}
-
 namespace TaskManager
 {
 class Q_DECL_HIDDEN VirtualDesktopInfo::Private : public QObject
diff --git a/logout-greeter/CMakeLists.txt b/logout-greeter/CMakeLists.txt
index 00ac163295..29262e1d7c 100644
--- a/logout-greeter/CMakeLists.txt
+++ b/logout-greeter/CMakeLists.txt
@@ -20,7 +20,6 @@ target_link_libraries(ksmserver-logout-greeter
     KF6::Package
     KF6::WindowSystem
     KF6::ConfigCore
-    X11::X11
     LayerShellQt::Interface
 )
 
diff --git a/logout-greeter/shutdowndlg.cpp b/logout-greeter/shutdowndlg.cpp
index 531a2a9a94..a406f022e8 100644
--- a/logout-greeter/shutdowndlg.cpp
+++ b/logout-greeter/shutdowndlg.cpp
@@ -30,15 +30,9 @@
 #include <KUser>
 #include <KWindowEffects>
 #include <KWindowSystem>
-#include <KX11Extras>
 #include <LayerShellQt/Window>
 
 #include <cstdio>
-#include <netwm.h>
-
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
-#include <fixx11h.h>
 
 #include <debug.h>
 
@@ -87,29 +81,6 @@ KSMShutdownDlg::KSMShutdownDlg(QWindow *parent, KWorkSpace::ShutdownType sdtype,
 
     setResizeMode(PlasmaQuick::QuickViewSharedEngine::SizeRootObjectToView);
 
-    // Qt doesn't set this on unmanaged windows
-    // FIXME: or does it?
-    if (KWindowSystem::isPlatformX11()) {
-        constexpr auto role = std::string_view("logoutdialog");
-        constexpr std::size_t roleLength = role.length();
-
-        auto x11App = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
-        XChangeProperty(x11App->display(),
-                        winId(),
-                        XInternAtom(x11App->display(), "WM_WINDOW_ROLE", False),
-                        XA_STRING,
-                        8,
-                        PropModeReplace,
-                        reinterpret_cast<const unsigned char *>(role.data()),
-                        roleLength);
-
-        XClassHint classHint;
-        classHint.res_name = const_cast<char *>("ksmserver-logout-greeter");
-        classHint.res_class = const_cast<char *>("ksmserver-logout-greeter");
-        XSetClassHint(x11App->display(), winId(), &classHint);
-        KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
-    }
-
     // QQuickView *windowContainer = QQuickView::createWindowContainer(m_view, this);
     // windowContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
     QQmlContext *context = rootContext();
@@ -244,12 +215,6 @@ void KSMShutdownDlg::resizeEvent(QResizeEvent *e)
 {
     QuickViewSharedEngine::resizeEvent(e);
 
-    if (KX11Extras::compositingActive()) {
-        // TODO: reenable window mask when we are without composite?
-        //        clearMask();
-    } else {
-        //        setMask(m_view->mask());
-    }
 }
 
 void KSMShutdownDlg::slotLogout()
diff --git a/runners/sessions/CMakeLists.txt b/runners/sessions/CMakeLists.txt
index 23ee4e25b1..0410cf4d8a 100644
--- a/runners/sessions/CMakeLists.txt
+++ b/runners/sessions/CMakeLists.txt
@@ -6,7 +6,5 @@ set(krunner_sessions_SRCS
     sessionrunner.cpp sessionrunner.h
 )
 
-qt_add_dbus_interface(krunner_sessions_SRCS ${SCREENSAVER_DBUS_INTERFACE} screensaver_interface)
-
 kcoreaddons_add_plugin(krunner_sessions SOURCES ${krunner_sessions_SRCS} INSTALL_NAMESPACE "kf6/krunner")
 target_link_libraries(krunner_sessions Qt::DBus KF6::Runner KF6::I18n PW::KWorkspace)
diff --git a/shell/desktopview.cpp b/shell/desktopview.cpp
index 9c3baa84b9..6576dd7f8d 100644
--- a/shell/desktopview.cpp
+++ b/shell/desktopview.cpp
@@ -22,9 +22,7 @@
 #include <PlasmaQuick/AppletQuickItem>
 
 #include <KAuthorized>
-#include <KStartupInfo>
 #include <KWaylandExtras>
-#include <KX11Extras>
 #include <klocalizedstring.h>
 #include <kwindowsystem.h>
 #include <plasmaactivities/controller.h>
@@ -52,9 +50,6 @@ DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen)
         m_layerWindow->setScope(QStringLiteral("desktop"));
         m_layerWindow->setCloseOnDismissed(false);
         m_layerWindow->setActivateOnShow(false);
-    } else {
-        KX11Extras::setType(winId(), NET::Desktop);
-        KX11Extras::setState(winId(), NET::KeepBelow);
     }
 
     if (targetScreen) {
@@ -529,9 +524,6 @@ void DesktopView::showConfigurationInterface(Plasma::Applet *applet)
         } else {
             m_configView->show();
             auto window = qobject_cast<QWindow *>(m_configView);
-            if (window && qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
-                KStartupInfo::setNewStartupId(window, qgetenv("DESKTOP_STARTUP_ID"));
-            }
             m_configView->requestActivate();
             return;
         }
@@ -572,9 +564,6 @@ void DesktopView::showConfigurationInterface(Plasma::Applet *applet)
     });
 
     auto window = qobject_cast<QWindow *>(m_configView);
-    if (window && qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
-        KStartupInfo::setNewStartupId(window, qgetenv("DESKTOP_STARTUP_ID"));
-    }
     m_configView->requestActivate();
 }
 
diff --git a/shell/panelview.cpp b/shell/panelview.cpp
index 5d52fbf389..7bdd009207 100644
--- a/shell/panelview.cpp
+++ b/shell/panelview.cpp
@@ -29,7 +29,6 @@
 #include <QScreen>
 
 #include <KLocalizedString>
-#include <KX11Extras>
 #include <kwindowsystem.h>
 
 #include <Plasma/Containment>
@@ -1451,7 +1450,6 @@ void PanelView::updateMask()
                                                  mask);
     }
 
-    if (!KWindowSystem::isPlatformX11() || KX11Extras::compositingActive()) {
         const QRect bounding = mask.boundingRect();
         // Always go to screen edge, to preserve fitts law
         switch (containment()->location()) {
@@ -1471,9 +1469,6 @@ void PanelView::updateMask()
             break;
         }
         setMask(screenPanelRect);
-    } else {
-        setMask(mask);
-    }
 }
 
 bool PanelView::canSetStrut() const
@@ -1773,9 +1768,6 @@ void PanelView::refreshStatus(Plasma::Types::ItemStatus status)
     if (status == Plasma::Types::NeedsAttentionStatus) {
         showTemporarily();
         setFlags(flags() | Qt::WindowDoesNotAcceptFocus);
-        if (KWindowSystem::isPlatformX11()) {
-            KX11Extras::setState(winId(), NET::SkipSwitcher | NET::KeepAbove);
-        }
         if (m_layerWindow) {
             m_layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityNone);
             requestUpdate();
@@ -1783,11 +1775,7 @@ void PanelView::refreshStatus(Plasma::Types::ItemStatus status)
     } else if (status == Plasma::Types::AcceptingInputStatus) {
         m_corona->savePreviousWindow();
         setFlags(flags() & ~Qt::WindowDoesNotAcceptFocus);
-        if (KWindowSystem::isPlatformX11()) {
-            KX11Extras::forceActiveWindow(winId());
-        } else {
             showTemporarily();
-        }
 
         if (m_layerWindow) {
             m_layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityOnDemand);
@@ -1809,9 +1797,6 @@ void PanelView::refreshStatus(Plasma::Types::ItemStatus status)
 
         restoreAutoHide();
         setFlags(flags() | Qt::WindowDoesNotAcceptFocus);
-        if (KWindowSystem::isPlatformX11()) {
-            KX11Extras::setState(winId(), NET::SkipSwitcher | NET::KeepAbove);
-        }
         if (m_layerWindow) {
             m_layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityNone);
             requestUpdate();
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 92cc348ad9..29e494e9a4 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -34,7 +34,6 @@
 #include <KPackage/PackageLoader>
 #include <KSycoca>
 #include <KWindowSystem>
-#include <KX11Extras>
 
 #include <Plasma/Plasma>
 #include <Plasma/PluginLoader>
diff --git a/soliduiserver/soliduiserver.cpp b/soliduiserver/soliduiserver.cpp
index 2f440021f4..281bc86ba0 100644
--- a/soliduiserver/soliduiserver.cpp
+++ b/soliduiserver/soliduiserver.cpp
@@ -18,7 +18,6 @@
 
 #include <KLocalizedString>
 #include <KPluginFactory>
-#include <KUserTimestamp>
 
 #include <kpassworddialog.h>
 #include <kwallet.h>
@@ -160,7 +159,6 @@ void SolidUiServer::reparentDialog(QWidget *dialog, WId wId, const QString &appI
 
     // allow dialog activation even if it interrupts, better than trying hacks
     // with keeping the dialog on top or on all desktops
-    KUserTimestamp::updateUserTimestamp();
 }
 
 #include "soliduiserver.moc"
diff --git a/startkde/CMakeLists.txt b/startkde/CMakeLists.txt
index 059830d10f..e063cbfacb 100644
--- a/startkde/CMakeLists.txt
+++ b/startkde/CMakeLists.txt
@@ -26,14 +26,8 @@ target_link_libraries(startplasma PUBLIC
     PW::KWorkspace
 )
 
-add_executable(startplasma-x11 ${START_PLASMA_COMMON_SRCS} startplasma-x11.cpp kcheckrunning/kcheckrunning.cpp)
 add_executable(startplasma-wayland ${START_PLASMA_COMMON_SRCS} startplasma-wayland.cpp)
 
-target_link_libraries(startplasma-x11 PRIVATE
-    startplasma
-    X11::X11 # for kcheckrunning
-)
-
 target_link_libraries(startplasma-wayland PRIVATE
     startplasma
 )
@@ -51,7 +45,6 @@ endif()
 
 configure_file(config-startplasma.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-startplasma.h)
 
-install(TARGETS startplasma-x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 install(TARGETS startplasma-wayland ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 install(PROGRAMS plasma-sourceenv.sh DESTINATION ${KDE_INSTALL_LIBEXECDIR})
 install(PROGRAMS plasma-dbus-run-session-if-needed DESTINATION ${KDE_INSTALL_LIBEXECDIR})
diff --git a/startkde/plasma-session/startup.cpp b/startkde/plasma-session/startup.cpp
index d873fc9472..83a3dd1f00 100644
--- a/startkde/plasma-session/startup.cpp
+++ b/startkde/plasma-session/startup.cpp
@@ -161,7 +161,7 @@ Startup::Startup(QObject *parent)
     } else {
         // This must block until started as it sets the WAYLAND_DISPLAY/DISPLAY env variables needed for the rest of the boot
         // fortunately it's very fast as it's just starting a wrapper
-        StartServiceJob kwinWaylandJob(QStringLiteral("kwin_wayland_wrapper"), {QStringLiteral("--xwayland")}, QStringLiteral("org.kde.KWinWrapper"));
+        StartServiceJob kwinWaylandJob(QStringLiteral("kwin_wayland_wrapper"), {}, QStringLiteral("org.kde.KWinWrapper"));
         kwinWaylandJob.exec();
         // kslpash is only launched in plasma-session from the wayland mode, for X it's in startplasma-x11