diff --git a/abstract_wayland_output.cpp b/abstract_wayland_output.cpp index 50566b9785..c86bb0c933 100644 --- a/abstract_wayland_output.cpp +++ b/abstract_wayland_output.cpp @@ -28,8 +28,8 @@ namespace KWin AbstractWaylandOutput::AbstractWaylandOutput(QObject *parent) : AbstractOutput(parent) { - m_waylandOutput = waylandServer()->display()->createOutput(this); - m_waylandOutputDevice = waylandServer()->display()->createOutputDevice(this); + m_waylandOutput = new KWaylandServer::OutputInterface(waylandServer()->display(), this); + m_waylandOutputDevice = new KWaylandServer::OutputDeviceInterface(waylandServer()->display(), this); m_xdgOutputV1 = waylandServer()->xdgOutputManagerV1()->createXdgOutput(m_waylandOutput, this); connect(m_waylandOutput, &KWaylandServer::OutputInterface::dpmsModeRequested, this, diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp index 6e548eec47..f61f82efc6 100644 --- a/effects/backgroundcontrast/contrast.cpp +++ b/effects/backgroundcontrast/contrast.cpp @@ -34,7 +34,7 @@ ContrastEffect::ContrastEffect() net_wm_contrast_region = effects->announceSupportProperty(s_contrastAtomName, this); KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { - m_contrastManager = display->createContrastManager(this); + m_contrastManager = new KWaylandServer::ContrastManagerInterface(display, this); } } else { net_wm_contrast_region = 0; diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 63eae7ec1c..adeeeeb710 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -44,7 +44,7 @@ BlurEffect::BlurEffect() net_wm_blur_region = effects->announceSupportProperty(s_blurAtomName, this); KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { - m_blurManager = display->createBlurManager(this); + m_blurManager = new KWaylandServer::BlurManagerInterface(display, this); } } else { net_wm_blur_region = 0; diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 837228d85c..dbf9c4ff71 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -31,7 +31,7 @@ SlidingPopupsEffect::SlidingPopupsEffect() initConfig(); KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { - display->createSlideManager(this); + new KWaylandServer::SlideManagerInterface(display, this); } m_slideLength = QFontMetrics(qApp->font()).height() * 8; diff --git a/input.cpp b/input.cpp index a9eb3fccd3..34ed3555bc 100644 --- a/input.cpp +++ b/input.cpp @@ -1986,7 +1986,7 @@ void InputRedirection::setupWorkspace() { if (waylandServer()) { using namespace KWaylandServer; - FakeInputInterface *fakeInput = waylandServer()->display()->createFakeInput(this); + FakeInputInterface *fakeInput = new FakeInputInterface(waylandServer()->display(), this); connect(fakeInput, &FakeInputInterface::deviceCreated, this, [this] (FakeInputDevice *device) { connect(device, &FakeInputDevice::authenticationRequested, this, @@ -2179,7 +2179,8 @@ void InputRedirection::setupLibInput() if (waylandServer()) { // create relative pointer manager - waylandServer()->display()->createRelativePointerManagerV1(waylandServer()->display()); + new KWaylandServer::RelativePointerManagerV1Interface(waylandServer()->display(), + waylandServer()->display()); } conn->setInputConfig(InputConfig::self()->inputConfig()); diff --git a/inputmethod.cpp b/inputmethod.cpp index a29f790fdc..8b9bd89f80 100644 --- a/inputmethod.cpp +++ b/inputmethod.cpp @@ -87,8 +87,8 @@ void InputMethod::init() connect(input(), &InputRedirection::keyStateChanged, this, &InputMethod::hide); if (waylandServer()) { - waylandServer()->display()->createTextInputManagerV2(); - waylandServer()->display()->createTextInputManagerV3(); + new TextInputManagerV2Interface(waylandServer()->display()); + new TextInputManagerV3Interface(waylandServer()->display()); connect(workspace(), &Workspace::clientAdded, this, &InputMethod::clientAdded); connect(waylandServer()->seat(), &SeatInterface::focusedTextInputSurfaceChanged, this, &InputMethod::handleFocusedSurfaceChanged); diff --git a/inputpanelv1integration.cpp b/inputpanelv1integration.cpp index 0d035f7a14..c4a3c82cf9 100644 --- a/inputpanelv1integration.cpp +++ b/inputpanelv1integration.cpp @@ -19,7 +19,7 @@ namespace KWin InputPanelV1Integration::InputPanelV1Integration(QObject *parent) : WaylandShellIntegration(parent) { - InputPanelV1Interface *shell = waylandServer()->display()->createInputPanelInterface(this); + InputPanelV1Interface *shell = new InputPanelV1Interface(waylandServer()->display(), this); connect(shell, &InputPanelV1Interface::inputPanelSurfaceAdded, this, &InputPanelV1Integration::createClient); diff --git a/layershellv1integration.cpp b/layershellv1integration.cpp index ebf5b70bb0..5527405b96 100644 --- a/layershellv1integration.cpp +++ b/layershellv1integration.cpp @@ -28,7 +28,7 @@ static const Qt::Edges AnchorVertical = Qt::TopEdge | Qt::BottomEdge; LayerShellV1Integration::LayerShellV1Integration(QObject *parent) : WaylandShellIntegration(parent) { - LayerShellV1Interface *shell = waylandServer()->display()->createLayerShellV1(this); + LayerShellV1Interface *shell = new LayerShellV1Interface(waylandServer()->display(), this); connect(shell, &KWaylandServer::LayerShellV1Interface::surfaceCreated, this, &LayerShellV1Integration::createClient); diff --git a/plugins/platforms/drm/egl_stream_backend.cpp b/plugins/platforms/drm/egl_stream_backend.cpp index 827e739288..37d71f34b9 100644 --- a/plugins/platforms/drm/egl_stream_backend.cpp +++ b/plugins/platforms/drm/egl_stream_backend.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "drm_gpu.h" @@ -252,7 +253,7 @@ void EglStreamBackend::init() initWayland(); using namespace KWaylandServer; - m_eglStreamControllerInterface = waylandServer()->display()->createEglStreamControllerInterface(); + m_eglStreamControllerInterface = new EglStreamControllerInterface(waylandServer()->display()); connect(m_eglStreamControllerInterface, &EglStreamControllerInterface::streamConsumerAttached, this, &EglStreamBackend::attachStreamConsumer); } diff --git a/plugins/screencast/screencastmanager.cpp b/plugins/screencast/screencastmanager.cpp index 80cc2ac5e2..4a2bcaed7f 100644 --- a/plugins/screencast/screencastmanager.cpp +++ b/plugins/screencast/screencastmanager.cpp @@ -29,7 +29,7 @@ namespace KWin ScreencastManager::ScreencastManager(QObject *parent) : Plugin(parent) - , m_screencast(waylandServer()->display()->createScreencastV1Interface(this)) + , m_screencast(new KWaylandServer::ScreencastV1Interface(waylandServer()->display(), this)) { connect(m_screencast, &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow); diff --git a/wayland_server.cpp b/wayland_server.cpp index 7b79a1c518..850057e48a 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -61,6 +61,10 @@ #include #include #include +#include +#include +#include +#include // Qt #include @@ -334,7 +338,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) if (!m_display->addSocketName(socketName)) { return false; } - m_compositor = m_display->createCompositor(m_display); + m_compositor = new CompositorInterface(m_display, m_display); connect(m_compositor, &CompositorInterface::surfaceCreated, this, [this] (SurfaceInterface *surface) { // check whether we have a Toplevel with the Surface's id @@ -368,8 +372,8 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } ); - m_tabletManagerV2 = m_display->createTabletManagerV2(m_display); - m_keyboardShortcutsInhibitManager = m_display->createKeyboardShortcutsInhibitManagerV1(m_display); + m_tabletManagerV2 = new TabletManagerV2Interface(m_display, m_display); + m_keyboardShortcutsInhibitManager = new KeyboardShortcutsInhibitManagerV1Interface(m_display, m_display); auto inputPanelV1Integration = new InputPanelV1Integration(this); connect(inputPanelV1Integration, &InputPanelV1Integration::clientCreated, @@ -383,7 +387,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) connect(layerShellV1Integration, &LayerShellV1Integration::clientCreated, this, &WaylandServer::registerShellClient); - m_xdgDecorationManagerV1 = m_display->createXdgDecorationManagerV1(m_display); + m_xdgDecorationManagerV1 = new XdgDecorationManagerV1Interface(m_display, m_display); connect(m_xdgDecorationManagerV1, &XdgDecorationManagerV1Interface::decorationCreated, this, [this](XdgToplevelDecorationV1Interface *decoration) { if (XdgToplevelClient *toplevel = findXdgToplevelClient(decoration->toplevel()->surface())) { @@ -392,20 +396,20 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } ); - m_display->createViewporter(); + new ViewporterInterface(m_display, m_display); m_display->createShm(); - m_seat = m_display->createSeat(m_display); + m_seat = new SeatInterface(m_display, m_display); m_seat->create(); - m_display->createPointerGesturesV1(m_display); - m_display->createPointerConstraintsV1(m_display); - m_dataDeviceManager = m_display->createDataDeviceManager(m_display); - m_display->createDataControlDeviceManagerV1(m_display); - m_display->createPrimarySelectionDeviceManagerV1(m_display); - m_idle = m_display->createIdle(m_display); + new PointerGesturesV1Interface(m_display, m_display); + new PointerConstraintsV1Interface(m_display, m_display); + m_dataDeviceManager = new DataDeviceManagerInterface(m_display, m_display); + new DataControlDeviceManagerV1Interface(m_display, m_display); + new PrimarySelectionDeviceManagerV1Interface(m_display, m_display); + m_idle = new IdleInterface(m_display, m_display); auto idleInhibition = new IdleInhibition(m_idle); connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerClient); - m_display->createIdleInhibitManagerV1(m_display); - m_plasmaShell = m_display->createPlasmaShell(m_display); + new IdleInhibitManagerV1Interface(m_display, m_display); + m_plasmaShell = new PlasmaShellInterface(m_display, m_display); connect(m_plasmaShell, &PlasmaShellInterface::surfaceCreated, [this] (PlasmaShellSurfaceInterface *surface) { if (XdgSurfaceClient *client = findXdgSurfaceClient(surface->surface())) { @@ -419,7 +423,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) }); } ); - m_appMenuManager = m_display->createAppMenuManagerInterface(m_display); + m_appMenuManager = new AppMenuManagerInterface(m_display, m_display); connect(m_appMenuManager, &AppMenuManagerInterface::appMenuCreated, [this] (AppMenuInterface *appMenu) { if (XdgToplevelClient *client = findXdgToplevelClient(appMenu->surface())) { @@ -427,7 +431,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } } ); - m_paletteManager = m_display->createServerSideDecorationPaletteManager(m_display); + m_paletteManager = new ServerSideDecorationPaletteManagerInterface(m_display, m_display); connect(m_paletteManager, &ServerSideDecorationPaletteManagerInterface::paletteCreated, [this] (ServerSideDecorationPaletteInterface *palette) { if (XdgToplevelClient *client = findXdgToplevelClient(palette->surface())) { @@ -436,7 +440,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } ); - m_windowManagement = m_display->createPlasmaWindowManagement(m_display); + m_windowManagement = new PlasmaWindowManagementInterface(m_display, m_display); m_windowManagement->setShowingDesktopState(PlasmaWindowManagementInterface::ShowingDesktopState::Disabled); connect(m_windowManagement, &PlasmaWindowManagementInterface::requestChangeShowingDesktop, this, [] (PlasmaWindowManagementInterface::ShowingDesktopState state) { @@ -462,14 +466,13 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } ); - m_virtualDesktopManagement = m_display->createPlasmaVirtualDesktopManagement(m_display); + m_virtualDesktopManagement = new PlasmaVirtualDesktopManagementInterface(m_display, m_display); m_windowManagement->setPlasmaVirtualDesktopManagementInterface(m_virtualDesktopManagement); - m_display->createShadowManager(m_display); + new ShadowManagerInterface(m_display, m_display); + new DpmsManagerInterface(m_display, m_display); - m_display->createDpmsManager(m_display); - - m_decorationManager = m_display->createServerSideDecorationManager(m_display); + m_decorationManager = new ServerSideDecorationManagerInterface(m_display, m_display); connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, [this] (ServerSideDecorationInterface *decoration) { if (XdgToplevelClient *client = findXdgToplevelClient(decoration->surface())) { @@ -484,22 +487,18 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) } ); - m_outputManagement = m_display->createOutputManagement(m_display); + m_outputManagement = new OutputManagementInterface(m_display, m_display); connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, this, [](KWaylandServer::OutputConfigurationInterface *config) { kwinApp()->platform()->requestOutputsChange(config); }); m_outputManagement->create(); - m_xdgOutputManagerV1 = m_display->createXdgOutputManagerV1(m_display); - - m_display->createSubCompositor(m_display); - - m_XdgForeign = m_display->createXdgForeignV2Interface(m_display); - - m_keyState = m_display->createKeyStateInterface(m_display); - - m_inputMethod = m_display->createInputMethodInterface(m_display); + m_xdgOutputManagerV1 = new XdgOutputManagerV1Interface(m_display, m_display); + new SubCompositorInterface(m_display, m_display); + m_XdgForeign = new XdgForeignV2Interface(m_display, m_display); + m_keyState = new KeyStateInterface(m_display, m_display); + m_inputMethod = new InputMethodV1Interface(m_display, m_display); return true; } @@ -507,7 +506,7 @@ bool WaylandServer::init(const QString &socketName, InitializationFlags flags) KWaylandServer::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() { if (!m_linuxDmabuf) { - m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); + m_linuxDmabuf = new LinuxDmabufUnstableV1Interface(m_display, m_display); m_linuxDmabuf->create(); } return m_linuxDmabuf; diff --git a/xdgshellintegration.cpp b/xdgshellintegration.cpp index f27f560e5c..40848e3d07 100644 --- a/xdgshellintegration.cpp +++ b/xdgshellintegration.cpp @@ -32,7 +32,7 @@ namespace KWin XdgShellIntegration::XdgShellIntegration(QObject *parent) : WaylandShellIntegration(parent) { - XdgShellInterface *shell = waylandServer()->display()->createXdgShell(this); + XdgShellInterface *shell = new XdgShellInterface(waylandServer()->display(), this); connect(shell, &XdgShellInterface::toplevelCreated, this, &XdgShellIntegration::registerXdgToplevel);