diff --git a/CMakeLists.txt b/CMakeLists.txt index 1900a3745..02e20e593 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -538,7 +538,6 @@ set(kwin_SRCS wayland_server.cpp waylandclient.cpp waylandshellintegration.cpp - waylandxdgshellintegration.cpp window_property_notify_x11_filter.cpp workspace.cpp x11client.cpp @@ -546,6 +545,7 @@ set(kwin_SRCS xcbutils.cpp xcursortheme.cpp xdgshellclient.cpp + xdgshellintegration.cpp xkb.cpp xwaylandclient.cpp xwl/xwayland_interface.cpp diff --git a/wayland_server.cpp b/wayland_server.cpp index cca9e558d..7a9d7bc56 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -15,7 +15,7 @@ #include "inputpanelv1integration.h" #include "screens.h" #include "layershellv1integration.h" -#include "waylandxdgshellintegration.h" +#include "xdgshellintegration.h" #include "workspace.h" #include "xdgshellclient.h" #include "service_utils.h" @@ -364,8 +364,8 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags connect(inputPanelV1Integration, &InputPanelV1Integration::clientCreated, this, &WaylandServer::registerShellClient); - auto xdgShellIntegration = new WaylandXdgShellIntegration(this); - connect(xdgShellIntegration, &WaylandXdgShellIntegration::clientCreated, + auto xdgShellIntegration = new XdgShellIntegration(this); + connect(xdgShellIntegration, &XdgShellIntegration::clientCreated, this, &WaylandServer::registerXdgGenericClient); auto layerShellV1Integration = new LayerShellV1Integration(this); diff --git a/waylandxdgshellintegration.cpp b/xdgshellintegration.cpp similarity index 81% rename from waylandxdgshellintegration.cpp rename to xdgshellintegration.cpp index 7c0f9de2a..f27f560e5 100644 --- a/waylandxdgshellintegration.cpp +++ b/xdgshellintegration.cpp @@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "waylandxdgshellintegration.h" +#include "xdgshellintegration.h" #include "wayland_server.h" #include "workspace.h" #include "xdgshellclient.h" @@ -29,18 +29,18 @@ namespace KWin * surface role of the underlying xdg_surface object. */ -WaylandXdgShellIntegration::WaylandXdgShellIntegration(QObject *parent) +XdgShellIntegration::XdgShellIntegration(QObject *parent) : WaylandShellIntegration(parent) { XdgShellInterface *shell = waylandServer()->display()->createXdgShell(this); connect(shell, &XdgShellInterface::toplevelCreated, - this, &WaylandXdgShellIntegration::registerXdgToplevel); + this, &XdgShellIntegration::registerXdgToplevel); connect(shell, &XdgShellInterface::popupCreated, - this, &WaylandXdgShellIntegration::registerXdgPopup); + this, &XdgShellIntegration::registerXdgPopup); } -void WaylandXdgShellIntegration::registerXdgToplevel(XdgToplevelInterface *toplevel) +void XdgShellIntegration::registerXdgToplevel(XdgToplevelInterface *toplevel) { // Note that the client is going to be destroyed and immediately re-created when the // underlying surface is unmapped. XdgToplevelClient is re-created right away since @@ -52,7 +52,7 @@ void WaylandXdgShellIntegration::registerXdgToplevel(XdgToplevelInterface *tople createXdgToplevelClient(toplevel); } -void WaylandXdgShellIntegration::createXdgToplevelClient(XdgToplevelInterface *toplevel) +void XdgShellIntegration::createXdgToplevelClient(XdgToplevelInterface *toplevel) { if (!workspace()) { qCWarning(KWIN_CORE, "An xdg-toplevel surface has been created while the compositor " @@ -63,7 +63,7 @@ void WaylandXdgShellIntegration::createXdgToplevelClient(XdgToplevelInterface *t emit clientCreated(new XdgToplevelClient(toplevel)); } -void WaylandXdgShellIntegration::registerXdgPopup(XdgPopupInterface *popup) +void XdgShellIntegration::registerXdgPopup(XdgPopupInterface *popup) { if (!workspace()) { qCWarning(KWIN_CORE, "An xdg-popup surface has been created while the compositor is " diff --git a/waylandxdgshellintegration.h b/xdgshellintegration.h similarity index 80% rename from waylandxdgshellintegration.h rename to xdgshellintegration.h index 5c2712a27..4f7b309df 100644 --- a/waylandxdgshellintegration.h +++ b/xdgshellintegration.h @@ -17,12 +17,12 @@ class XdgPopupInterface; namespace KWin { -class WaylandXdgShellIntegration : public WaylandShellIntegration +class XdgShellIntegration : public WaylandShellIntegration { Q_OBJECT public: - explicit WaylandXdgShellIntegration(QObject *parent = nullptr); + explicit XdgShellIntegration(QObject *parent = nullptr); private: void registerXdgToplevel(KWaylandServer::XdgToplevelInterface *toplevel);