diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,12 @@ PURPOSE "For screenlocker integration in kwin_wayland" ) +find_package(KWaylandServer CONFIG REQUIRED) +set_package_properties(KWaylandServer PROPERTIES + TYPE REQUIRED + PURPOSE "For Wayland integration" +) + find_package(Breeze 5.9.0 CONFIG) set_package_properties(Breeze PROPERTIES TYPE OPTIONAL @@ -637,7 +643,7 @@ set(kwin_WAYLAND_LIBS KF5::WaylandClient - KF5::WaylandServer + Plasma::KWaylandServer Wayland::Cursor XKB::XKB ${CMAKE_THREAD_LIBS_INIT} diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -31,13 +31,10 @@ #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class PlasmaWindowInterface; } -} namespace KDecoration2 { @@ -867,7 +864,7 @@ /** * Return window management interface */ - KWayland::Server::PlasmaWindowInterface *windowManagementInterface() const { + KWaylandServer::PlasmaWindowInterface *windowManagementInterface() const { return m_windowManagementInterface; } @@ -1231,7 +1228,7 @@ static QHash> s_palettes; static std::shared_ptr s_defaultPalette; - KWayland::Server::PlasmaWindowInterface *m_windowManagementInterface = nullptr; + KWaylandServer::PlasmaWindowInterface *m_windowManagementInterface = nullptr; AbstractClient *m_transientFor = nullptr; QList m_transients; diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -37,7 +37,7 @@ #include "workspace.h" #include "wayland_server.h" -#include +#include #include @@ -1348,7 +1348,7 @@ if (!waylandServer()->windowManagement()) { return; } - using namespace KWayland::Server; + using namespace KWaylandServer; auto w = waylandServer()->windowManagement()->createWindow(waylandServer()->windowManagement()); w->setTitle(caption()); w->setVirtualDesktop(isOnAllDesktops() ? 0 : desktop() - 1); diff --git a/abstract_output.h b/abstract_output.h --- a/abstract_output.h +++ b/abstract_output.h @@ -27,13 +27,10 @@ #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class OutputChangeSet; } -} namespace KWin { @@ -127,7 +124,7 @@ * * Default implementation does nothing */ - virtual void applyChanges(const KWayland::Server::OutputChangeSet *changeSet); + virtual void applyChanges(const KWaylandServer::OutputChangeSet *changeSet); /** * Returns geometry of this output in device independent pixels. diff --git a/abstract_output.cpp b/abstract_output.cpp --- a/abstract_output.cpp +++ b/abstract_output.cpp @@ -83,7 +83,7 @@ Q_UNUSED(enable) } -void AbstractOutput::applyChanges(const KWayland::Server::OutputChangeSet *changeSet) +void AbstractOutput::applyChanges(const KWaylandServer::OutputChangeSet *changeSet) { Q_UNUSED(changeSet) } diff --git a/abstract_wayland_output.h b/abstract_wayland_output.h --- a/abstract_wayland_output.h +++ b/abstract_wayland_output.h @@ -31,20 +31,17 @@ #include #include -#include -#include +#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class OutputInterface; class OutputDeviceInterface; class OutputChangeSet; class OutputManagementInterface; class XdgOutputInterface; } -} namespace KWin { @@ -109,9 +106,9 @@ void setGlobalPos(const QPoint &pos); void setScale(qreal scale); - void applyChanges(const KWayland::Server::OutputChangeSet *changeSet) override; + void applyChanges(const KWaylandServer::OutputChangeSet *changeSet) override; - QPointer waylandOutput() const { + QPointer waylandOutput() const { return m_waylandOutput; } @@ -132,7 +129,7 @@ protected: void initInterfaces(const QString &model, const QString &manufacturer, const QByteArray &uuid, const QSize &physicalSize, - const QVector &modes); + const QVector &modes); QPoint globalPos() const; @@ -152,7 +149,7 @@ virtual void updateEnablement(bool enable) { Q_UNUSED(enable); } - virtual void updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) { + virtual void updateDpms(KWaylandServer::OutputInterface::DpmsMode mode) { Q_UNUSED(mode); } virtual void updateMode(int modeIndex) { @@ -168,12 +165,12 @@ QSize orientateSize(const QSize &size) const; private: - void setTransform(KWayland::Server::OutputDeviceInterface::Transform transform); + void setTransform(KWaylandServer::OutputDeviceInterface::Transform transform); - KWayland::Server::OutputInterface *m_waylandOutput; - KWayland::Server::XdgOutputInterface *m_xdgOutput; - KWayland::Server::OutputDeviceInterface *m_waylandOutputDevice; - KWayland::Server::OutputInterface::DpmsMode m_dpms = KWayland::Server::OutputInterface::DpmsMode::On; + KWaylandServer::OutputInterface *m_waylandOutput; + KWaylandServer::XdgOutputInterface *m_xdgOutput; + KWaylandServer::OutputDeviceInterface *m_waylandOutputDevice; + KWaylandServer::OutputInterface::DpmsMode m_dpms = KWaylandServer::OutputInterface::DpmsMode::On; QString m_name; bool m_internal = false; diff --git a/abstract_wayland_output.cpp b/abstract_wayland_output.cpp --- a/abstract_wayland_output.cpp +++ b/abstract_wayland_output.cpp @@ -24,9 +24,9 @@ #include "wayland_server.h" // KWayland -#include -#include -#include +#include +#include +#include // KF5 #include @@ -42,8 +42,8 @@ m_waylandOutputDevice = waylandServer()->display()->createOutputDevice(this); m_xdgOutput = waylandServer()->xdgOutputManager()->createXdgOutput(m_waylandOutput, this); - connect(m_waylandOutput, &KWayland::Server::OutputInterface::dpmsModeRequested, this, - [this] (KWayland::Server::OutputInterface::DpmsMode mode) { + connect(m_waylandOutput, &KWaylandServer::OutputInterface::dpmsModeRequested, this, + [this] (KWaylandServer::OutputInterface::DpmsMode mode) { updateDpms(mode); }); } @@ -121,12 +121,12 @@ m_xdgOutput->done(); } -using DeviceInterface = KWayland::Server::OutputDeviceInterface; +using DeviceInterface = KWaylandServer::OutputDeviceInterface; -KWayland::Server::OutputInterface::Transform toOutputTransform(DeviceInterface::Transform transform) +KWaylandServer::OutputInterface::Transform toOutputTransform(DeviceInterface::Transform transform) { using Transform = DeviceInterface::Transform; - using OutputTransform = KWayland::Server::OutputInterface::Transform; + using OutputTransform = KWaylandServer::OutputInterface::Transform; switch (transform) { case Transform::Rotated90: @@ -169,7 +169,7 @@ return static_cast(transform); } -void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet *changeSet) +void AbstractWaylandOutput::applyChanges(const KWaylandServer::OutputChangeSet *changeSet) { qCDebug(KWIN_CORE) << "Apply changes to the Wayland output."; bool emitModeChanged = false; @@ -270,12 +270,12 @@ qCDebug(KWIN_CORE).nospace() << "Adding mode " << ++i << ": " << mode.size << " [" << mode.refreshRate << "]"; m_waylandOutputDevice->addMode(mode); - KWayland::Server::OutputInterface::ModeFlags flags; + KWaylandServer::OutputInterface::ModeFlags flags; if (mode.flags & DeviceInterface::ModeFlag::Current) { - flags |= KWayland::Server::OutputInterface::ModeFlag::Current; + flags |= KWaylandServer::OutputInterface::ModeFlag::Current; } if (mode.flags & DeviceInterface::ModeFlag::Preferred) { - flags |= KWayland::Server::OutputInterface::ModeFlag::Preferred; + flags |= KWaylandServer::OutputInterface::ModeFlag::Preferred; } m_waylandOutput->addMode(mode.size, flags, mode.refreshRate); } diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -43,7 +43,7 @@ KF5::ConfigCore KF5::GlobalAccel KF5::I18n - KF5::WaylandServer + Plasma::KWaylandServer KF5::WindowSystem ) add_test(NAME kwin-testVirtualDesktops COMMAND testVirtualDesktops) @@ -311,7 +311,7 @@ KF5::GlobalAccel KF5::I18n KF5::Notifications - KF5::WaylandServer + Plasma::KWaylandServer KF5::WindowSystem XCB::COMPOSITE @@ -402,7 +402,7 @@ Qt5::Widgets KF5::ConfigCore - KF5::WaylandServer + Plasma::KWaylandServer KF5::WindowSystem XKB::XKB diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include using namespace KWin; using namespace KWayland::Client; @@ -106,7 +106,7 @@ QVERIFY(c->isDecorated()); // destroy physical size - KWayland::Server::Display *display = waylandServer()->display(); + KWaylandServer::Display *display = waylandServer()->display(); auto output = display->outputs().first(); output->setPhysicalSize(QSize(0, 0)); // and fake a cursor theme change, so that the theme gets recreated diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -29,7 +29,7 @@ #include "workspace.h" #include -#include +#include #include #include diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -27,12 +27,12 @@ #include #include -#include -#include +#include +#include using namespace KWin; using namespace KWayland::Client; -using KWayland::Server::IdleInterface; +using KWaylandServer::IdleInterface; static const QString s_socketName = QStringLiteral("wayland_test_kwin_idle_inhbition_test-0"); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include namespace KWin { diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include //screenlocker #include diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include //screenlocker #include diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -262,7 +262,7 @@ confinedPointer.reset(nullptr); Test::flushWaylandConnection(); - QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWayland::Server::SurfaceInterface::pointerConstraintsChanged); + QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged); QVERIFY(constraintsChangedSpy.isValid()); QVERIFY(constraintsChangedSpy.wait()); @@ -349,7 +349,7 @@ lockedPointer.reset(nullptr); Test::flushWaylandConnection(); - QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWayland::Server::SurfaceInterface::pointerConstraintsChanged); + QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged); QVERIFY(constraintsChangedSpy.isValid()); QVERIFY(constraintsChangedSpy.wait()); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -41,9 +41,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -75,7 +75,7 @@ waylandServer()->internalClientConection()->flush(); waylandServer()->dispatch(); - auto buffer = KWayland::Server::BufferInterface::get( + auto buffer = KWaylandServer::BufferInterface::get( waylandServer()->internalConnection()->getResource( KWayland::Client::Buffer::getId(b))); if (!buffer) { diff --git a/autotests/integration/scene_opengl_shadow_test.cpp b/autotests/integration/scene_opengl_shadow_test.cpp --- a/autotests/integration/scene_opengl_shadow_test.cpp +++ b/autotests/integration/scene_opengl_shadow_test.cpp @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include "kwin_wayland_test.h" @@ -728,14 +728,14 @@ clientShadow->setOffsets(QMarginsF(128, 128, 128, 128)); - QSignalSpy shadowChangedSpy(client->surface(), &KWayland::Server::SurfaceInterface::shadowChanged); + QSignalSpy shadowChangedSpy(client->surface(), &KWaylandServer::SurfaceInterface::shadowChanged); QVERIFY(shadowChangedSpy.isValid()); clientShadow->commit(); surface->commit(Surface::CommitFlag::None); QVERIFY(shadowChangedSpy.wait()); // Check that we got right shadow from the client. - QPointer shadowIface = client->surface()->shadow(); + QPointer shadowIface = client->surface()->shadow(); QVERIFY(!shadowIface.isNull()); QCOMPARE(shadowIface->offset().left(), 128.0); QCOMPARE(shadowIface->offset().top(), 128.0); @@ -808,14 +808,14 @@ clientShadow->setOffsets(QMarginsF(256, 256, 256, 0)); - QSignalSpy shadowChangedSpy(client->surface(), &KWayland::Server::SurfaceInterface::shadowChanged); + QSignalSpy shadowChangedSpy(client->surface(), &KWaylandServer::SurfaceInterface::shadowChanged); QVERIFY(shadowChangedSpy.isValid()); clientShadow->commit(); surface->commit(Surface::CommitFlag::None); QVERIFY(shadowChangedSpy.wait()); // Check that we got right shadow from the client. - QPointer shadowIface = client->surface()->shadow(); + QPointer shadowIface = client->surface()->shadow(); QVERIFY(!shadowIface.isNull()); QCOMPARE(shadowIface->offset().left(), 256.0); QCOMPARE(shadowIface->offset().top(), 256.0); diff --git a/autotests/integration/scene_qpainter_shadow_test.cpp b/autotests/integration/scene_qpainter_shadow_test.cpp --- a/autotests/integration/scene_qpainter_shadow_test.cpp +++ b/autotests/integration/scene_qpainter_shadow_test.cpp @@ -37,8 +37,8 @@ #include #include #include -#include -#include +#include +#include #include "kwin_wayland_test.h" @@ -753,7 +753,7 @@ clientShadow->setOffsets(QMarginsF(128, 128, 128, 128)); // Commit shadow. - QSignalSpy shadowChangedSpy(client->surface(), &KWayland::Server::SurfaceInterface::shadowChanged); + QSignalSpy shadowChangedSpy(client->surface(), &KWaylandServer::SurfaceInterface::shadowChanged); QVERIFY(shadowChangedSpy.isValid()); clientShadow->commit(); surface->commit(Surface::CommitFlag::None); diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include //screenlocker #include diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include namespace KWin { diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -44,9 +44,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -27,7 +27,7 @@ #include "wayland_server.h" #include "workspace.h" -#include +#include #include diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -26,7 +26,7 @@ #include "workspace.h" #include "../../xwl/databridge.h" -#include +#include #include #include @@ -114,7 +114,7 @@ QVERIFY(clientAddedSpy.isValid()); QSignalSpy shellClientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); QVERIFY(shellClientAddedSpy.isValid()); - QSignalSpy clipboardChangedSpy(Xwl::DataBridge::self()->dataDeviceIface(), &KWayland::Server::DataDeviceInterface::selectionChanged); + QSignalSpy clipboardChangedSpy(Xwl::DataBridge::self()->dataDeviceIface(), &KWaylandServer::DataDeviceInterface::selectionChanged); QVERIFY(clipboardChangedSpy.isValid()); QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); diff --git a/autotests/mock_effectshandler.h b/autotests/mock_effectshandler.h --- a/autotests/mock_effectshandler.h +++ b/autotests/mock_effectshandler.h @@ -131,7 +131,7 @@ KWin::EffectWindow *findWindow(WId) const override { return nullptr; } - KWin::EffectWindow *findWindow(KWayland::Server::SurfaceInterface *) const override { + KWin::EffectWindow *findWindow(KWaylandServer::SurfaceInterface *) const override { return nullptr; } KWin::EffectWindow *findWindow(QWindow *w) const override { @@ -240,7 +240,7 @@ xcb_window_t x11RootWindow() const override { return QX11Info::appRootWindow(); } - KWayland::Server::Display *waylandDisplay() const override { + KWaylandServer::Display *waylandDisplay() const override { return nullptr; } diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -236,7 +236,7 @@ bool skipsCloseAnimation() const override { return false; } - KWayland::Server::SurfaceInterface *surface() const override { + KWaylandServer::SurfaceInterface *surface() const override { return nullptr; } bool isFullScreen() const override { diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -39,7 +39,7 @@ #include -#include +#include #include #include diff --git a/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -37,10 +37,10 @@ #include "ui_debug_console.h" // KWayland -#include -#include -#include -#include +#include +#include +#include +#include // frameworks #include #include @@ -732,9 +732,9 @@ return QStringLiteral("%1,%2 %3x%4").arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height()); } default: - if (value.userType() == qMetaTypeId()) { - if (auto s = value.value()) { - return QStringLiteral("KWayland::Server::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16); + if (value.userType() == qMetaTypeId()) { + if (auto s = value.value()) { + return QStringLiteral("KWaylandServer::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16); } else { return QStringLiteral("nullptr"); } @@ -1272,7 +1272,7 @@ beginResetModel(); endResetModel(); }; - using namespace KWayland::Server; + using namespace KWaylandServer; const auto unmangeds = workspace()->unmanagedList(); for (auto u : unmangeds) { @@ -1332,7 +1332,7 @@ int SurfaceTreeModel::rowCount(const QModelIndex &parent) const { if (parent.isValid()) { - using namespace KWayland::Server; + using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(parent.internalPointer())) { const auto &children = surface->childSubSurfaces(); return children.count(); @@ -1353,7 +1353,7 @@ } if (parent.isValid()) { - using namespace KWayland::Server; + using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(parent.internalPointer())) { const auto &children = surface->childSubSurfaces(); if (row < children.count()) { @@ -1385,7 +1385,7 @@ QModelIndex SurfaceTreeModel::parent(const QModelIndex &child) const { - using namespace KWayland::Server; + using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(child.internalPointer())) { const auto &subsurface = surface->subSurface(); if (subsurface.isNull()) { @@ -1444,7 +1444,7 @@ if (!index.isValid()) { return QVariant(); } - using namespace KWayland::Server; + using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(index.internalPointer())) { if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { return QStringLiteral("%1 (%2) - %3").arg(surface->client()->executablePath()) diff --git a/decorations/decorationbridge.cpp b/decorations/decorationbridge.cpp --- a/decorations/decorationbridge.cpp +++ b/decorations/decorationbridge.cpp @@ -36,7 +36,7 @@ #include // KWayland -#include +#include // Frameworks #include @@ -111,7 +111,7 @@ void DecorationBridge::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; m_noPlugin = readNoPlugin(); if (m_noPlugin) { if (waylandServer()) { diff --git a/effects.h b/effects.h --- a/effects.h +++ b/effects.h @@ -35,13 +35,10 @@ class Theme; } -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class Display; } -} class QDBusPendingCallWatcher; class QDBusServiceWatcher; @@ -134,7 +131,7 @@ void startMousePolling() override; void stopMousePolling() override; EffectWindow* findWindow(WId id) const override; - EffectWindow* findWindow(KWayland::Server::SurfaceInterface *surf) const override; + EffectWindow* findWindow(KWaylandServer::SurfaceInterface *surf) const override; EffectWindow *findWindow(QWindow *w) const override; EffectWindow *findWindow(const QUuid &id) const override; EffectWindowList stackingOrder() const override; @@ -231,7 +228,7 @@ return m_currentRenderedDesktop; } - KWayland::Server::Display *waylandDisplay() const override; + KWaylandServer::Display *waylandDisplay() const override; bool animationsSupported() const override; @@ -453,7 +450,7 @@ bool isPopupWindow() const override; bool isOutline() const override; - KWayland::Server::SurfaceInterface *surface() const override; + KWaylandServer::SurfaceInterface *surface() const override; bool isFullScreen() const override; bool isUnresponsive() const override; diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -1095,7 +1095,7 @@ return nullptr; } -EffectWindow* EffectsHandlerImpl::findWindow(KWayland::Server::SurfaceInterface *surf) const +EffectWindow* EffectsHandlerImpl::findWindow(KWaylandServer::SurfaceInterface *surf) const { if (waylandServer()) { if (AbstractClient *w = waylandServer()->findClient(surf)) { @@ -1546,7 +1546,7 @@ return ret; } -KWayland::Server::Display *EffectsHandlerImpl::waylandDisplay() const +KWaylandServer::Display *EffectsHandlerImpl::waylandDisplay() const { if (waylandServer()) { return waylandServer()->display(); @@ -1863,7 +1863,7 @@ TOPLEVEL_HELPER(QString, windowRole, windowRole) TOPLEVEL_HELPER(QStringList, activities, activities) TOPLEVEL_HELPER(bool, skipsCloseAnimation, skipsCloseAnimation) -TOPLEVEL_HELPER(KWayland::Server::SurfaceInterface *, surface, surface) +TOPLEVEL_HELPER(KWaylandServer::SurfaceInterface *, surface, surface) TOPLEVEL_HELPER(bool, isPopupWindow, isPopupWindow) TOPLEVEL_HELPER(bool, isOutline, isOutline) TOPLEVEL_HELPER(pid_t, pid, pid) diff --git a/effects/backgroundcontrast/contrast.h b/effects/backgroundcontrast/contrast.h --- a/effects/backgroundcontrast/contrast.h +++ b/effects/backgroundcontrast/contrast.h @@ -28,13 +28,10 @@ #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class ContrastManagerInterface; } -} namespace KWin { @@ -87,7 +84,7 @@ QRegion m_currentContrast; // keeps track of the currently contrasted area of non-caching windows(from bottom to top) QHash< const EffectWindow*, QMatrix4x4> m_colorMatrices; QHash< const EffectWindow*, QMetaObject::Connection > m_contrastChangedConnections; // used only in Wayland to keep track of effect changed - KWayland::Server::ContrastManagerInterface *m_contrastManager = nullptr; + KWaylandServer::ContrastManagerInterface *m_contrastManager = nullptr; }; inline diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp --- a/effects/backgroundcontrast/contrast.cpp +++ b/effects/backgroundcontrast/contrast.cpp @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include namespace KWin { @@ -45,7 +45,7 @@ // Should be included in _NET_SUPPORTED instead. if (shader && shader->isValid()) { net_wm_contrast_region = effects->announceSupportProperty(s_contrastAtomName, this); - KWayland::Server::Display *display = effects->waylandDisplay(); + KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { m_contrastManager = display->createContrastManager(this); m_contrastManager->create(); @@ -133,7 +133,7 @@ } } - KWayland::Server::SurfaceInterface *surf = w->surface(); + KWaylandServer::SurfaceInterface *surf = w->surface(); if (surf && surf->contrast()) { region = surf->contrast()->region(); @@ -174,10 +174,10 @@ void ContrastEffect::slotWindowAdded(EffectWindow *w) { - KWayland::Server::SurfaceInterface *surf = w->surface(); + KWaylandServer::SurfaceInterface *surf = w->surface(); if (surf) { - m_contrastChangedConnections[w] = connect(surf, &KWayland::Server::SurfaceInterface::contrastChanged, this, [this, w] () { + m_contrastChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::contrastChanged, this, [this, w] () { if (w) { updateContrastRegion(w); diff --git a/effects/blur/blur.h b/effects/blur/blur.h --- a/effects/blur/blur.h +++ b/effects/blur/blur.h @@ -29,13 +29,10 @@ #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class BlurManagerInterface; } -} namespace KWin { @@ -131,7 +128,7 @@ QVector blurStrengthValues; QMap windowBlurChangedConnections; - KWayland::Server::BlurManagerInterface *m_blurManager = nullptr; + KWaylandServer::BlurManagerInterface *m_blurManager = nullptr; }; inline diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -31,10 +31,10 @@ #include #include // for ceil() -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -55,7 +55,7 @@ // Should be included in _NET_SUPPORTED instead. if (m_shader && m_shader->isValid() && m_renderTargetsValid) { net_wm_blur_region = effects->announceSupportProperty(s_blurAtomName, this); - KWayland::Server::Display *display = effects->waylandDisplay(); + KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { m_blurManager = display->createBlurManager(this); m_blurManager->create(); @@ -291,7 +291,7 @@ } } - KWayland::Server::SurfaceInterface *surf = w->surface(); + KWaylandServer::SurfaceInterface *surf = w->surface(); if (surf && surf->blur()) { region = surf->blur()->region(); @@ -317,10 +317,10 @@ void BlurEffect::slotWindowAdded(EffectWindow *w) { - KWayland::Server::SurfaceInterface *surf = w->surface(); + KWaylandServer::SurfaceInterface *surf = w->surface(); if (surf) { - windowBlurChangedConnections[w] = connect(surf, &KWayland::Server::SurfaceInterface::blurChanged, this, [this, w] () { + windowBlurChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::blurChanged, this, [this, w] () { if (w) { updateBlurRegion(w); } diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -40,7 +40,7 @@ SlidingPopupsEffect::SlidingPopupsEffect() { initConfig(); - KWayland::Server::Display *display = effects->waylandDisplay(); + KWaylandServer::Display *display = effects->waylandDisplay(); if (display) { display->createSlideManager(this)->create(); } @@ -200,7 +200,7 @@ //Wayland if (auto surf = w->surface()) { slotWaylandSlideOnShowChanged(w); - connect(surf, &KWayland::Server::SurfaceInterface::slideOnShowHideChanged, this, [this, surf] { + connect(surf, &KWaylandServer::SurfaceInterface::slideOnShowHideChanged, this, [this, surf] { slotWaylandSlideOnShowChanged(effects->findWindow(surf)); }); } @@ -354,7 +354,7 @@ return; } - KWayland::Server::SurfaceInterface *surf = w->surface(); + KWaylandServer::SurfaceInterface *surf = w->surface(); if (!surf) { return; } @@ -365,16 +365,16 @@ animData.offset = surf->slideOnShowHide()->offset(); switch (surf->slideOnShowHide()->location()) { - case KWayland::Server::SlideInterface::Location::Top: + case KWaylandServer::SlideInterface::Location::Top: animData.location = Location::Top; break; - case KWayland::Server::SlideInterface::Location::Left: + case KWaylandServer::SlideInterface::Location::Left: animData.location = Location::Left; break; - case KWayland::Server::SlideInterface::Location::Right: + case KWaylandServer::SlideInterface::Location::Right: animData.location = Location::Right; break; - case KWayland::Server::SlideInterface::Location::Bottom: + case KWaylandServer::SlideInterface::Location::Bottom: default: animData.location = Location::Bottom; break; diff --git a/events.cpp b/events.cpp --- a/events.cpp +++ b/events.cpp @@ -63,7 +63,7 @@ #include "x11eventfilter.h" #include "wayland_server.h" -#include +#include #ifndef XCB_GE_GENERIC #define XCB_GE_GENERIC 35 @@ -1345,7 +1345,7 @@ if (e->type == atoms->wl_surface_id) { m_surfaceId = e->data.data32[0]; if (auto w = waylandServer()) { - if (auto s = KWayland::Server::SurfaceInterface::get(m_surfaceId, w->xWaylandConnection())) { + if (auto s = KWaylandServer::SurfaceInterface::get(m_surfaceId, w->xWaylandConnection())) { setSurface(s); } } diff --git a/idle_inhibition.h b/idle_inhibition.h --- a/idle_inhibition.h +++ b/idle_inhibition.h @@ -24,15 +24,12 @@ #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class IdleInterface; } -} -using KWayland::Server::IdleInterface; +using KWaylandServer::IdleInterface; namespace KWin { diff --git a/idle_inhibition.cpp b/idle_inhibition.cpp --- a/idle_inhibition.cpp +++ b/idle_inhibition.cpp @@ -23,13 +23,13 @@ #include "deleted.h" #include "workspace.h" -#include -#include +#include +#include #include #include -using KWayland::Server::SurfaceInterface; +using KWaylandServer::SurfaceInterface; namespace KWin { diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -51,13 +51,13 @@ #include "cursor.h" #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include //screenlocker @@ -421,23 +421,23 @@ return waylandServer()->isScreenLocked(); } private: - bool surfaceAllowed(KWayland::Server::SurfaceInterface *(KWayland::Server::SeatInterface::*method)() const) const { - if (KWayland::Server::SurfaceInterface *s = (waylandServer()->seat()->*method)()) { + bool surfaceAllowed(KWaylandServer::SurfaceInterface *(KWaylandServer::SeatInterface::*method)() const) const { + if (KWaylandServer::SurfaceInterface *s = (waylandServer()->seat()->*method)()) { if (Toplevel *t = waylandServer()->findClient(s)) { return t->isLockScreen() || t->isInputMethod(); } return false; } return true; } bool pointerSurfaceAllowed() const { - return surfaceAllowed(&KWayland::Server::SeatInterface::focusedPointerSurface); + return surfaceAllowed(&KWaylandServer::SeatInterface::focusedPointerSurface); } bool keyboardSurfaceAllowed() const { - return surfaceAllowed(&KWayland::Server::SeatInterface::focusedKeyboardSurface); + return surfaceAllowed(&KWaylandServer::SeatInterface::focusedKeyboardSurface); } bool touchSurfaceAllowed() const { - return surfaceAllowed(&KWayland::Server::SeatInterface::focusedTouchSurface); + return surfaceAllowed(&KWaylandServer::SeatInterface::focusedTouchSurface); } }; @@ -1406,23 +1406,23 @@ auto seat = waylandServer()->seat(); seat->setTimestamp(event->timestamp()); auto _event = static_cast(event); - KWayland::Server::PointerAxisSource source; + KWaylandServer::PointerAxisSource source; switch (_event->axisSource()) { case KWin::InputRedirection::PointerAxisSourceWheel: - source = KWayland::Server::PointerAxisSource::Wheel; + source = KWaylandServer::PointerAxisSource::Wheel; break; case KWin::InputRedirection::PointerAxisSourceFinger: - source = KWayland::Server::PointerAxisSource::Finger; + source = KWaylandServer::PointerAxisSource::Finger; break; case KWin::InputRedirection::PointerAxisSourceContinuous: - source = KWayland::Server::PointerAxisSource::Continuous; + source = KWaylandServer::PointerAxisSource::Continuous; break; case KWin::InputRedirection::PointerAxisSourceWheelTilt: - source = KWayland::Server::PointerAxisSource::WheelTilt; + source = KWaylandServer::PointerAxisSource::WheelTilt; break; case KWin::InputRedirection::PointerAxisSourceUnknown: default: - source = KWayland::Server::PointerAxisSource::Unknown; + source = KWaylandServer::PointerAxisSource::Unknown; break; } seat->pointerAxisV5(_event->orientation(), _event->delta(), _event->discreteDelta(), source); @@ -1551,7 +1551,7 @@ } }; -static KWayland::Server::SeatInterface *findSeat() +static KWaylandServer::SeatInterface *findSeat() { auto server = waylandServer(); if (!server) { @@ -1570,28 +1570,28 @@ { } - static KWayland::Server::TabletSeatInterface *findTabletSeat() + static KWaylandServer::TabletSeatInterface *findTabletSeat() { auto server = waylandServer(); if (!server) { return nullptr; } - KWayland::Server::TabletManagerInterface *manager = server->tabletManager(); + KWaylandServer::TabletManagerInterface *manager = server->tabletManager(); return manager->seat(findSeat()); } void integrateDevice(LibInput::Device *device) { if (device->isTabletTool()) { - KWayland::Server::TabletSeatInterface *tabletSeat = findTabletSeat(); + KWaylandServer::TabletSeatInterface *tabletSeat = findTabletSeat(); struct udev_device *const udev_device = libinput_device_get_udev_device(device->device()); const char *devnode = udev_device_get_devnode(udev_device); tabletSeat->addTablet(device->vendor(), device->product(), device->sysName(), device->name(), {QString::fromUtf8(devnode)}); } } void removeDevice(const QString &sysname) { - KWayland::Server::TabletSeatInterface *tabletSeat = findTabletSeat(); + KWaylandServer::TabletSeatInterface *tabletSeat = findTabletSeat(); tabletSeat->removeTablet(sysname); } @@ -1601,10 +1601,10 @@ return false; } - KWayland::Server::TabletSeatInterface *tabletSeat = findTabletSeat(); + KWaylandServer::TabletSeatInterface *tabletSeat = findTabletSeat(); auto tool = tabletSeat->toolByHardwareSerial(event->serialId()); if (!tool) { - using namespace KWayland::Server; + using namespace KWaylandServer; const QVector capabilities = event->capabilities(); const auto f = [](InputRedirection::Capability cap) { @@ -1697,14 +1697,14 @@ emit cursor->cursorChanged(); } - KWayland::Server::TabletInterface *tablet = tabletSeat->tabletByName(event->tabletSysName()); + KWaylandServer::TabletInterface *tablet = tabletSeat->tabletByName(event->tabletSysName()); Toplevel *toplevel = input()->findToplevel(event->globalPos()); if (!toplevel || !toplevel->surface()) { return false; } - KWayland::Server::SurfaceInterface *surface = toplevel->surface(); + KWaylandServer::SurfaceInterface *surface = toplevel->surface(); tool->setCurrentSurface(surface); if (!tool->isClientSupported() || !tablet->isSurfaceSupported(surface)) { @@ -1768,7 +1768,7 @@ waylandServer()->simulateUserActivity(); return true; } - QHash m_cursorByTool; + QHash m_cursorByTool; }; class DragAndDropInputFilter : public InputEventFilter @@ -1981,7 +1981,7 @@ void InputRedirection::setupWorkspace() { if (waylandServer()) { - using namespace KWayland::Server; + using namespace KWaylandServer; FakeInputInterface *fakeInput = waylandServer()->display()->createFakeInput(this); fakeInput->create(); connect(fakeInput, &FakeInputInterface::deviceCreated, this, @@ -2173,7 +2173,7 @@ if (waylandServer()) { // create relative pointer manager - waylandServer()->display()->createRelativePointerManager(KWayland::Server::RelativePointerInterfaceVersion::UnstableV1, waylandServer()->display())->create(); + waylandServer()->display()->createRelativePointerManager(KWaylandServer::RelativePointerInterfaceVersion::UnstableV1, waylandServer()->display())->create(); } conn->setInputConfig(kwinApp()->inputConfig()); diff --git a/keyboard_input.cpp b/keyboard_input.cpp --- a/keyboard_input.cpp +++ b/keyboard_input.cpp @@ -30,8 +30,8 @@ #include "wayland_server.h" #include "workspace.h" // KWayland -#include -#include +#include +#include //screenlocker #include // Frameworks diff --git a/keyboard_repeat.cpp b/keyboard_repeat.cpp --- a/keyboard_repeat.cpp +++ b/keyboard_repeat.cpp @@ -22,7 +22,7 @@ #include "input_event.h" #include "wayland_server.h" -#include +#include #include diff --git a/libkwineffects/CMakeLists.txt b/libkwineffects/CMakeLists.txt --- a/libkwineffects/CMakeLists.txt +++ b/libkwineffects/CMakeLists.txt @@ -21,7 +21,7 @@ Qt5::Core Qt5::Gui - KF5::WaylandServer + Plasma::KWaylandServer XCB::RENDER XCB::XCB diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -65,11 +65,9 @@ */ Q_DECLARE_LOGGING_CATEGORY(KWINEFFECTS) -namespace KWayland { - namespace Server { - class SurfaceInterface; - class Display; - } +namespace KWaylandServer { + class SurfaceInterface; + class Display; } namespace KWin @@ -1084,7 +1082,7 @@ virtual WindowQuadType newWindowQuadType() = 0; Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(WId id) const = 0; - Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(KWayland::Server::SurfaceInterface *surf) const = 0; + Q_SCRIPTABLE virtual KWin::EffectWindow* findWindow(KWaylandServer::SurfaceInterface *surf) const = 0; /** * Finds the EffectWindow for the internal window @p w. * If there is no such window @c null is returned. @@ -1257,7 +1255,7 @@ * on Wayland, on X11 it will be nullptr * @since 5.5 */ - virtual KWayland::Server::Display *waylandDisplay() const = 0; + virtual KWaylandServer::Display *waylandDisplay() const = 0; /** * Whether animations are supported by the Scene. @@ -2062,7 +2060,7 @@ * Interface to the corresponding wayland surface. * relevant only in Wayland, on X11 it will be nullptr */ - Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) + Q_PROPERTY(KWaylandServer::SurfaceInterface *surface READ surface) /** * Whether the window is fullscreen. @@ -2409,7 +2407,7 @@ /** * @since 5.5 */ - virtual KWayland::Server::SurfaceInterface *surface() const = 0; + virtual KWaylandServer::SurfaceInterface *surface() const = 0; /** * @since 5.6 diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #ifdef KWIN_HAVE_XRENDER_COMPOSITING #include diff --git a/linux_dmabuf.h b/linux_dmabuf.h --- a/linux_dmabuf.h +++ b/linux_dmabuf.h @@ -21,18 +21,18 @@ #include -#include +#include #include namespace KWin { -class KWIN_EXPORT DmabufBuffer : public KWayland::Server::LinuxDmabufUnstableV1Buffer +class KWIN_EXPORT DmabufBuffer : public KWaylandServer::LinuxDmabufUnstableV1Buffer { public: - using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; + using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; + using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; DmabufBuffer(const QVector &planes, uint32_t format, @@ -53,16 +53,16 @@ Flags m_flags; }; -class KWIN_EXPORT LinuxDmabuf : public KWayland::Server::LinuxDmabufUnstableV1Interface::Impl +class KWIN_EXPORT LinuxDmabuf : public KWaylandServer::LinuxDmabufUnstableV1Interface::Impl { public: - using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; + using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; + using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; explicit LinuxDmabuf(); ~LinuxDmabuf() override; - KWayland::Server::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, + KWaylandServer::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, uint32_t format, const QSize &size, Flags flags) override; diff --git a/linux_dmabuf.cpp b/linux_dmabuf.cpp --- a/linux_dmabuf.cpp +++ b/linux_dmabuf.cpp @@ -30,7 +30,7 @@ uint32_t format, const QSize &size, Flags flags) - : KWayland::Server::LinuxDmabufUnstableV1Buffer(format, size) + : KWaylandServer::LinuxDmabufUnstableV1Buffer(format, size) , m_planes(planes) , m_format(format) , m_size(size) @@ -53,7 +53,7 @@ } LinuxDmabuf::LinuxDmabuf() - : KWayland::Server::LinuxDmabufUnstableV1Interface::Impl() + : KWaylandServer::LinuxDmabufUnstableV1Interface::Impl() { Q_ASSERT(waylandServer()); waylandServer()->linuxDmabuf()->setImpl(this); @@ -64,10 +64,10 @@ waylandServer()->linuxDmabuf()->setImpl(nullptr); } -using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; -using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; +using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; +using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; -KWayland::Server::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVector &planes, +KWaylandServer::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVector &planes, uint32_t format, const QSize &size, Flags flags) diff --git a/main.cpp b/main.cpp --- a/main.cpp +++ b/main.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include // Qt #include #include @@ -111,7 +111,7 @@ { qRegisterMetaType("Options::WindowOperation"); qRegisterMetaType(); - qRegisterMetaType("KWayland::Server::SurfaceInterface *"); + qRegisterMetaType("KWaylandServer::SurfaceInterface *"); qRegisterMetaType(); } diff --git a/main_wayland.cpp b/main_wayland.cpp --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -30,8 +30,8 @@ #include "xwl/xwayland.h" // KWayland -#include -#include +#include +#include // KDE #include #include diff --git a/platform.h b/platform.h --- a/platform.h +++ b/platform.h @@ -33,10 +33,8 @@ class QAction; -namespace KWayland { - namespace Server { - class OutputConfigurationInterface; - } +namespace KWaylandServer { +class OutputConfigurationInterface; } namespace KWin @@ -184,7 +182,7 @@ * Base implementation warns that the current backend does not implement this * functionality. */ - void requestOutputsChange(KWayland::Server::OutputConfigurationInterface *config); + void requestOutputsChange(KWaylandServer::OutputConfigurationInterface *config); /** * Whether the Platform requires compositing for rendering. diff --git a/platform.cpp b/platform.cpp --- a/platform.cpp +++ b/platform.cpp @@ -34,8 +34,8 @@ #include "wayland_server.h" #include "colorcorrection/manager.h" -#include -#include +#include +#include #include @@ -121,21 +121,21 @@ new InputRedirectionCursor(parent); } -void Platform::requestOutputsChange(KWayland::Server::OutputConfigurationInterface *config) +void Platform::requestOutputsChange(KWaylandServer::OutputConfigurationInterface *config) { if (!m_supportsOutputChanges) { qCWarning(KWIN_CORE) << "This backend does not support configuration changes."; config->setFailed(); return; } - using Enablement = KWayland::Server::OutputDeviceInterface::Enablement; + using Enablement = KWaylandServer::OutputDeviceInterface::Enablement; const auto changes = config->changes(); //process all non-disabling changes for (auto it = changes.begin(); it != changes.end(); it++) { - const KWayland::Server::OutputChangeSet *changeset = it.value(); + const KWaylandServer::OutputChangeSet *changeset = it.value(); auto output = findOutput(it.key()->uuid()); if (!output) { @@ -152,7 +152,7 @@ //process any disable requests for (auto it = changes.begin(); it != changes.end(); it++) { - const KWayland::Server::OutputChangeSet *changeset = it.value(); + const KWaylandServer::OutputChangeSet *changeset = it.value(); if (changeset->enabledChanged() && changeset->enabled() == Enablement::Disabled) { diff --git a/platformsupport/scenes/opengl/CMakeLists.txt b/platformsupport/scenes/opengl/CMakeLists.txt --- a/platformsupport/scenes/opengl/CMakeLists.txt +++ b/platformsupport/scenes/opengl/CMakeLists.txt @@ -21,4 +21,4 @@ ) add_library(SceneOpenGLBackend STATIC ${SCENE_OPENGL_BACKEND_SRCS}) -target_link_libraries(SceneOpenGLBackend Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::ConfigCore KF5::WindowSystem KF5::WaylandServer) +target_link_libraries(SceneOpenGLBackend Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::ConfigCore KF5::WindowSystem Plasma::KWaylandServer) diff --git a/platformsupport/scenes/opengl/abstract_egl_backend.h b/platformsupport/scenes/opengl/abstract_egl_backend.h --- a/platformsupport/scenes/opengl/abstract_egl_backend.h +++ b/platformsupport/scenes/opengl/abstract_egl_backend.h @@ -28,13 +28,10 @@ class QOpenGLFramebufferObject; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class BufferInterface; } -} namespace KWin { @@ -113,11 +110,11 @@ private: void createTextureSubImage(int scale, const QImage &image, const QRegion &damage); bool createTextureImage(const QImage &image); - bool loadShmTexture(const QPointer &buffer); - bool loadEglTexture(const QPointer &buffer); - bool loadDmabufTexture(const QPointer< KWayland::Server::BufferInterface > &buffer); + bool loadShmTexture(const QPointer &buffer); + bool loadEglTexture(const QPointer &buffer); + bool loadDmabufTexture(const QPointer< KWaylandServer::BufferInterface > &buffer); bool loadInternalImageObject(WindowPixmap *pixmap); - EGLImageKHR attach(const QPointer &buffer); + EGLImageKHR attach(const QPointer &buffer); bool updateFromFBO(const QSharedPointer &fbo); bool updateFromInternalImageObject(WindowPixmap *pixmap); SceneOpenGLTexture *q; diff --git a/platformsupport/scenes/opengl/abstract_egl_backend.cpp b/platformsupport/scenes/opengl/abstract_egl_backend.cpp --- a/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -26,9 +26,9 @@ #include "platform.h" #include "scene.h" #include "wayland_server.h" -#include -#include -#include +#include +#include +#include // kwin libs #include #include @@ -397,7 +397,7 @@ m_image = EGL_NO_IMAGE_KHR; // The wl_buffer has ownership of the image // The origin in a dmabuf-buffer is at the upper-left corner, so the meaning // of Y-inverted is the inverse of OpenGL. - const bool yInverted = !(dmabuf->flags() & KWayland::Server::LinuxDmabufUnstableV1Interface::YInverted); + const bool yInverted = !(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted); if (m_size != dmabuf->size() || yInverted != q->isYInverted()) { m_size = dmabuf->size(); q->setYInverted(yInverted); @@ -516,12 +516,12 @@ q->unbind(); } -bool AbstractEglTexture::loadShmTexture(const QPointer< KWayland::Server::BufferInterface > &buffer) +bool AbstractEglTexture::loadShmTexture(const QPointer< KWaylandServer::BufferInterface > &buffer) { return createTextureImage(buffer->data()); } -bool AbstractEglTexture::loadEglTexture(const QPointer< KWayland::Server::BufferInterface > &buffer) +bool AbstractEglTexture::loadEglTexture(const QPointer< KWaylandServer::BufferInterface > &buffer) { if (!eglQueryWaylandBufferWL) { return false; @@ -546,7 +546,7 @@ return true; } -bool AbstractEglTexture::loadDmabufTexture(const QPointer< KWayland::Server::BufferInterface > &buffer) +bool AbstractEglTexture::loadDmabufTexture(const QPointer< KWaylandServer::BufferInterface > &buffer) { auto *dmabuf = static_cast(buffer->linuxDmabufBuffer()); if (!dmabuf || dmabuf->images()[0] == EGL_NO_IMAGE_KHR) { @@ -565,7 +565,7 @@ q->unbind(); m_size = dmabuf->size(); - q->setYInverted(!(dmabuf->flags() & KWayland::Server::LinuxDmabufUnstableV1Interface::YInverted)); + q->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted)); return true; } @@ -575,7 +575,7 @@ return createTextureImage(pixmap->internalImage()); } -EGLImageKHR AbstractEglTexture::attach(const QPointer< KWayland::Server::BufferInterface > &buffer) +EGLImageKHR AbstractEglTexture::attach(const QPointer< KWaylandServer::BufferInterface > &buffer) { EGLint format, yInverted; eglQueryWaylandBufferWL(m_backend->eglDisplay(), buffer->resource(), EGL_TEXTURE_FORMAT, &format); diff --git a/platformsupport/scenes/opengl/egl_dmabuf.h b/platformsupport/scenes/opengl/egl_dmabuf.h --- a/platformsupport/scenes/opengl/egl_dmabuf.h +++ b/platformsupport/scenes/opengl/egl_dmabuf.h @@ -33,8 +33,8 @@ class EglDmabufBuffer : public DmabufBuffer { public: - using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; + using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; + using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; enum class ImportType { Direct, @@ -71,15 +71,15 @@ class EglDmabuf : public LinuxDmabuf { public: - using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; + using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; + using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; static EglDmabuf* factory(AbstractEglBackend *backend); explicit EglDmabuf(AbstractEglBackend *backend); ~EglDmabuf() override; - KWayland::Server::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, + KWaylandServer::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, uint32_t format, const QSize &size, Flags flags) override; @@ -89,7 +89,7 @@ uint32_t format, const QSize &size); - KWayland::Server::LinuxDmabufUnstableV1Buffer *yuvImport(const QVector &planes, + KWaylandServer::LinuxDmabufUnstableV1Buffer *yuvImport(const QVector &planes, uint32_t format, const QSize &size, Flags flags); diff --git a/platformsupport/scenes/opengl/egl_dmabuf.cpp b/platformsupport/scenes/opengl/egl_dmabuf.cpp --- a/platformsupport/scenes/opengl/egl_dmabuf.cpp +++ b/platformsupport/scenes/opengl/egl_dmabuf.cpp @@ -218,8 +218,8 @@ m_images.clear(); } -using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; -using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; +using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; +using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; EGLImage EglDmabuf::createImage(const QVector &planes, uint32_t format, @@ -296,7 +296,7 @@ return image; } -KWayland::Server::LinuxDmabufUnstableV1Buffer* EglDmabuf::importBuffer(const QVector &planes, +KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::importBuffer(const QVector &planes, uint32_t format, const QSize &size, Flags flags) @@ -316,7 +316,7 @@ return nullptr; } -KWayland::Server::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector &planes, +KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector &planes, uint32_t format, const QSize &size, Flags flags) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -39,7 +39,7 @@ #include "egl_stream_backend.h" #endif // KWayland -#include +#include // KF5 #include #include @@ -156,7 +156,7 @@ { m_dpmsFilter.reset(); for (auto it = m_enabledOutputs.constBegin(), end = m_enabledOutputs.constEnd(); it != end; it++) { - (*it)->updateDpms(KWayland::Server::OutputInterface::DpmsMode::On); + (*it)->updateDpms(KWaylandServer::OutputInterface::DpmsMode::On); } } @@ -634,7 +634,7 @@ #endif m_cursorEnabled = waylandServer()->seat()->hasPointer(); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::hasPointerChanged, this, + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::hasPointerChanged, this, [this] { m_cursorEnabled = waylandServer()->seat()->hasPointer(); if (usesSoftwareCursor()) { diff --git a/plugins/platforms/drm/drm_inputeventfilter.cpp b/plugins/platforms/drm/drm_inputeventfilter.cpp --- a/plugins/platforms/drm/drm_inputeventfilter.cpp +++ b/plugins/platforms/drm/drm_inputeventfilter.cpp @@ -23,7 +23,7 @@ #include -#include +#include namespace KWin { diff --git a/plugins/platforms/drm/drm_output.h b/plugins/platforms/drm/drm_output.h --- a/plugins/platforms/drm/drm_output.h +++ b/plugins/platforms/drm/drm_output.h @@ -146,7 +146,7 @@ void dpmsFinishOff(); bool atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable); - void updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) override; + void updateDpms(KWaylandServer::OutputInterface::DpmsMode mode) override; void updateMode(int modeIndex) override; void setWaylandMode(); diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -31,7 +31,7 @@ #include "screens_drm.h" #include "wayland_server.h" // KWayland -#include +#include // KF5 #include #include @@ -282,7 +282,7 @@ return false; } - updateDpms(KWayland::Server::OutputInterface::DpmsMode::On); + updateDpms(KWaylandServer::OutputInterface::DpmsMode::On); return true; } @@ -324,20 +324,20 @@ const QString model = connectorName + QStringLiteral("-") + modelName; // read in mode information - QVector modes; + QVector modes; for (int i = 0; i < connector->count_modes; ++i) { // TODO: in AMS here we could read and store for later every mode's blob_id // would simplify isCurrentMode(..) and presentAtomically(..) in case of mode set auto *m = &connector->modes[i]; - KWayland::Server::OutputDeviceInterface::ModeFlags deviceflags; + KWaylandServer::OutputDeviceInterface::ModeFlags deviceflags; if (isCurrentMode(m)) { - deviceflags |= KWayland::Server::OutputDeviceInterface::ModeFlag::Current; + deviceflags |= KWaylandServer::OutputDeviceInterface::ModeFlag::Current; } if (m->type & DRM_MODE_TYPE_PREFERRED) { - deviceflags |= KWayland::Server::OutputDeviceInterface::ModeFlag::Preferred; + deviceflags |= KWaylandServer::OutputDeviceInterface::ModeFlag::Preferred; } - KWayland::Server::OutputDeviceInterface::Mode mode; + KWaylandServer::OutputDeviceInterface::Mode mode; mode.id = i; mode.size = QSize(m->hdisplay, m->vdisplay); mode.flags = deviceflags; @@ -535,9 +535,9 @@ } } -static DrmOutput::DpmsMode fromWaylandDpmsMode(KWayland::Server::OutputInterface::DpmsMode wlMode) +static DrmOutput::DpmsMode fromWaylandDpmsMode(KWaylandServer::OutputInterface::DpmsMode wlMode) { - using namespace KWayland::Server; + using namespace KWaylandServer; switch (wlMode) { case OutputInterface::DpmsMode::On: return DrmOutput::DpmsMode::On; @@ -552,9 +552,9 @@ } } -static KWayland::Server::OutputInterface::DpmsMode toWaylandDpmsMode(DrmOutput::DpmsMode mode) +static KWaylandServer::OutputInterface::DpmsMode toWaylandDpmsMode(DrmOutput::DpmsMode mode) { - using namespace KWayland::Server; + using namespace KWaylandServer; switch (mode) { case DrmOutput::DpmsMode::On: return OutputInterface::DpmsMode::On; @@ -569,7 +569,7 @@ } } -void DrmOutput::updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) +void DrmOutput::updateDpms(KWaylandServer::OutputInterface::DpmsMode mode) { if (m_dpms.isNull() || !isEnabled()) { return; diff --git a/plugins/platforms/drm/egl_stream_backend.h b/plugins/platforms/drm/egl_stream_backend.h --- a/plugins/platforms/drm/egl_stream_backend.h +++ b/plugins/platforms/drm/egl_stream_backend.h @@ -20,8 +20,8 @@ #ifndef KWIN_EGL_STREAM_BACKEND_H #define KWIN_EGL_STREAM_BACKEND_H #include "abstract_egl_backend.h" -#include -#include +#include +#include #include namespace KWin @@ -63,8 +63,8 @@ EGLStreamKHR stream; GLuint texture; }; - StreamTexture *lookupStreamTexture(KWayland::Server::SurfaceInterface *surface); - void attachStreamConsumer(KWayland::Server::SurfaceInterface *surface, + StreamTexture *lookupStreamTexture(KWaylandServer::SurfaceInterface *surface); + void attachStreamConsumer(KWaylandServer::SurfaceInterface *surface, void *eglStream, wl_array *attribs); struct Output @@ -82,8 +82,8 @@ DrmBackend *m_backend; QVector m_outputs; - KWayland::Server::EglStreamControllerInterface *m_eglStreamControllerInterface; - QHash m_streamTextures; + KWaylandServer::EglStreamControllerInterface *m_eglStreamControllerInterface; + QHash m_streamTextures; friend class EglStreamTexture; }; @@ -103,7 +103,7 @@ bool acquireStreamFrame(EGLStreamKHR stream); void createFbo(); void copyExternalTexture(GLuint tex); - bool attachBuffer(KWayland::Server::BufferInterface *buffer); + bool attachBuffer(KWaylandServer::BufferInterface *buffer); EglStreamBackend *m_backend; GLuint m_fbo, m_rbo; GLenum m_format; diff --git a/plugins/platforms/drm/egl_stream_backend.cpp b/plugins/platforms/drm/egl_stream_backend.cpp --- a/plugins/platforms/drm/egl_stream_backend.cpp +++ b/plugins/platforms/drm/egl_stream_backend.cpp @@ -31,11 +31,11 @@ #include "wayland_server.h" #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include namespace KWin @@ -210,15 +210,15 @@ return true; } -EglStreamBackend::StreamTexture *EglStreamBackend::lookupStreamTexture(KWayland::Server::SurfaceInterface *surface) +EglStreamBackend::StreamTexture *EglStreamBackend::lookupStreamTexture(KWaylandServer::SurfaceInterface *surface) { auto it = m_streamTextures.find(surface); return it != m_streamTextures.end() ? &it.value() : nullptr; } -void EglStreamBackend::attachStreamConsumer(KWayland::Server::SurfaceInterface *surface, +void EglStreamBackend::attachStreamConsumer(KWaylandServer::SurfaceInterface *surface, void *eglStream, wl_array *attribs) { @@ -248,7 +248,7 @@ m_streamTextures.insert(surface, newSt); texture = newSt.texture; - connect(surface, &KWayland::Server::Resource::unbound, this, + connect(surface, &KWaylandServer::Resource::unbound, this, [surface, this]() { const StreamTexture &st = m_streamTextures.take(surface); pEglDestroyStreamKHR(eglDisplay(), st.stream); @@ -283,7 +283,7 @@ setSupportsBufferAge(false); initWayland(); - using namespace KWayland::Server; + using namespace KWaylandServer; m_eglStreamControllerInterface = waylandServer()->display()->createEglStreamControllerInterface(); connect(m_eglStreamControllerInterface, &EglStreamControllerInterface::streamConsumerAttached, this, &EglStreamBackend::attachStreamConsumer); @@ -618,7 +618,7 @@ glViewport(oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]); } -bool EglStreamTexture::attachBuffer(KWayland::Server::BufferInterface *buffer) +bool EglStreamTexture::attachBuffer(KWaylandServer::BufferInterface *buffer) { QSize oldSize = m_size; m_size = buffer->size(); @@ -639,7 +639,7 @@ bool EglStreamTexture::loadTexture(WindowPixmap *pixmap) { - using namespace KWayland::Server; + using namespace KWaylandServer; SurfaceInterface *surface = pixmap->surface(); const EglStreamBackend::StreamTexture *st = m_backend->lookupStreamTexture(surface); if (!pixmap->buffer().isNull() && st != nullptr) { @@ -667,7 +667,7 @@ void EglStreamTexture::updateTexture(WindowPixmap *pixmap) { - using namespace KWayland::Server; + using namespace KWaylandServer; SurfaceInterface *surface = pixmap->surface(); const EglStreamBackend::StreamTexture *st = m_backend->lookupStreamTexture(surface); if (!pixmap->buffer().isNull() && st != nullptr) { diff --git a/plugins/platforms/drm/remoteaccess_manager.h b/plugins/platforms/drm/remoteaccess_manager.h --- a/plugins/platforms/drm/remoteaccess_manager.h +++ b/plugins/platforms/drm/remoteaccess_manager.h @@ -21,8 +21,8 @@ #define REMOTEACCESSMANAGER_H // KWayland -#include -#include +#include +#include // Qt #include @@ -35,8 +35,8 @@ class DrmOutput; class DrmBuffer; -using KWayland::Server::RemoteAccessManagerInterface; -using KWayland::Server::BufferHandle; +using KWaylandServer::RemoteAccessManagerInterface; +using KWaylandServer::BufferHandle; class RemoteAccessManager : public QObject { diff --git a/plugins/platforms/drm/remoteaccess_manager.cpp b/plugins/platforms/drm/remoteaccess_manager.cpp --- a/plugins/platforms/drm/remoteaccess_manager.cpp +++ b/plugins/platforms/drm/remoteaccess_manager.cpp @@ -25,7 +25,7 @@ #include "../../../wayland_server.h" // system -#include +#include #include #include diff --git a/plugins/platforms/fbdev/fb_backend.cpp b/plugins/platforms/fbdev/fb_backend.cpp --- a/plugins/platforms/fbdev/fb_backend.cpp +++ b/plugins/platforms/fbdev/fb_backend.cpp @@ -45,10 +45,10 @@ void FramebufferOutput::init(const QSize &pixelSize, const QSize &physicalSize) { - KWayland::Server::OutputDeviceInterface::Mode mode; + KWaylandServer::OutputDeviceInterface::Mode mode; mode.id = 0; mode.size = pixelSize; - mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; + mode.flags = KWaylandServer::OutputDeviceInterface::ModeFlag::Current; mode.refreshRate = 60000; // TODO: get actual refresh rate of fb device? initInterfaces("model_TODO", "manufacturer_TODO", "UUID_TODO", physicalSize, { mode }); } diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.h b/plugins/platforms/hwcomposer/hwcomposer_backend.h --- a/plugins/platforms/hwcomposer/hwcomposer_backend.h +++ b/plugins/platforms/hwcomposer/hwcomposer_backend.h @@ -55,9 +55,9 @@ ~HwcomposerOutput() override; bool isValid() const; - void updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) override; + void updateDpms(KWaylandServer::OutputInterface::DpmsMode mode) override; Q_SIGNALS: - void dpmsModeRequested(KWayland::Server::OutputInterface::DpmsMode mode); + void dpmsModeRequested(KWaylandServer::OutputInterface::DpmsMode mode); private: QSize m_pixelSize; hwc_composer_device_1_t *m_device; diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp --- a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp +++ b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp @@ -26,7 +26,7 @@ #include "main.h" #include "wayland_server.h" // KWayland -#include +#include // KDE #include // Qt @@ -40,7 +40,7 @@ // based on test_hwcomposer.c from libhybris project (Apache 2 licensed) -using namespace KWayland::Server; +using namespace KWaylandServer; namespace KWin { @@ -226,7 +226,7 @@ } if (m_lights) { - using namespace KWayland::Server; + using namespace KWaylandServer; auto updateDpms = [this] { if (!m_output || !m_output->waylandOutput()) { @@ -236,7 +236,7 @@ connect(this, &HwcomposerBackend::outputBlankChanged, this, updateDpms); connect(m_output.data(), &HwcomposerOutput::dpmsModeRequested, this, - [this] (KWayland::Server::OutputInterface::DpmsMode mode) { + [this] (KWaylandServer::OutputInterface::DpmsMode mode) { if (mode == OutputInterface::DpmsMode::On) { if (m_outputBlank) { toggleBlankOutput(); @@ -541,7 +541,7 @@ return isEnabled(); } -void HwcomposerOutput::updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) +void HwcomposerOutput::updateDpms(KWaylandServer::OutputInterface::DpmsMode mode) { emit dpmsModeRequested(mode); } diff --git a/plugins/platforms/virtual/virtual_backend.cpp b/plugins/platforms/virtual/virtual_backend.cpp --- a/plugins/platforms/virtual/virtual_backend.cpp +++ b/plugins/platforms/virtual/virtual_backend.cpp @@ -26,7 +26,7 @@ // Qt #include // KWayland -#include +#include // system #include #include diff --git a/plugins/platforms/virtual/virtual_output.cpp b/plugins/platforms/virtual/virtual_output.cpp --- a/plugins/platforms/virtual/virtual_output.cpp +++ b/plugins/platforms/virtual/virtual_output.cpp @@ -37,10 +37,10 @@ void VirtualOutput::init(const QPoint &logicalPosition, const QSize &pixelSize) { - KWayland::Server::OutputDeviceInterface::Mode mode; + KWaylandServer::OutputDeviceInterface::Mode mode; mode.id = 0; mode.size = pixelSize; - mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; + mode.flags = KWaylandServer::OutputDeviceInterface::ModeFlag::Current; mode.refreshRate = 60000; // TODO initInterfaces("model_TODO", "manufacturer_TODO", "UUID_TODO", pixelSize, { mode }); setGeometry(QRect(logicalPosition, pixelSize)); diff --git a/plugins/platforms/wayland/egl_wayland_backend.cpp b/plugins/platforms/wayland/egl_wayland_backend.cpp --- a/plugins/platforms/wayland/egl_wayland_backend.cpp +++ b/plugins/platforms/wayland/egl_wayland_backend.cpp @@ -37,8 +37,8 @@ // KDE #include -#include -#include +#include +#include // Qt #include diff --git a/plugins/platforms/wayland/wayland_backend.cpp b/plugins/platforms/wayland/wayland_backend.cpp --- a/plugins/platforms/wayland/wayland_backend.cpp +++ b/plugins/platforms/wayland/wayland_backend.cpp @@ -58,7 +58,7 @@ #include #include -#include +#include #include #include @@ -338,7 +338,7 @@ ); WaylandServer *server = waylandServer(); if (server) { - using namespace KWayland::Server; + using namespace KWaylandServer; SeatInterface *si = server->seat(); connect(m_seat, &Seat::hasKeyboardChanged, si, &SeatInterface::setHasKeyboard); connect(m_seat, &Seat::hasPointerChanged, si, &SeatInterface::setHasPointer); diff --git a/plugins/platforms/wayland/wayland_output.cpp b/plugins/platforms/wayland/wayland_output.cpp --- a/plugins/platforms/wayland/wayland_output.cpp +++ b/plugins/platforms/wayland/wayland_output.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include @@ -59,10 +59,10 @@ void WaylandOutput::init(const QPoint &logicalPosition, const QSize &pixelSize) { - KWayland::Server::OutputDeviceInterface::Mode mode; + KWaylandServer::OutputDeviceInterface::Mode mode; mode.id = 0; mode.size = pixelSize; - mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; + mode.flags = KWaylandServer::OutputDeviceInterface::ModeFlag::Current; mode.refreshRate = 60000; // TODO: can we get refresh rate data from Wayland host? initInterfaces("model_TODO", "manufacturer_TODO", "UUID_TODO", pixelSize, { mode }); setGeometry(logicalPosition, pixelSize); diff --git a/plugins/platforms/x11/windowed/x11windowed_backend.cpp b/plugins/platforms/x11/windowed/x11windowed_backend.cpp --- a/plugins/platforms/x11/windowed/x11windowed_backend.cpp +++ b/plugins/platforms/x11/windowed/x11windowed_backend.cpp @@ -34,8 +34,8 @@ #include #include // kwayland -#include -#include +#include +#include // xcb #include // X11 diff --git a/plugins/platforms/x11/windowed/x11windowed_output.cpp b/plugins/platforms/x11/windowed/x11windowed_output.cpp --- a/plugins/platforms/x11/windowed/x11windowed_output.cpp +++ b/plugins/platforms/x11/windowed/x11windowed_output.cpp @@ -53,10 +53,10 @@ void X11WindowedOutput::init(const QPoint &logicalPosition, const QSize &pixelSize) { - KWayland::Server::OutputDeviceInterface::Mode mode; + KWaylandServer::OutputDeviceInterface::Mode mode; mode.id = 0; mode.size = pixelSize; - mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; + mode.flags = KWaylandServer::OutputDeviceInterface::ModeFlag::Current; mode.refreshRate = 60000; // TODO: get refresh rate via randr // Physicial size must be adjusted, such that QPA calculates correct sizes of diff --git a/plugins/scenes/opengl/scene_opengl.h b/plugins/scenes/opengl/scene_opengl.h --- a/plugins/scenes/opengl/scene_opengl.h +++ b/plugins/scenes/opengl/scene_opengl.h @@ -203,9 +203,9 @@ bool bind(); bool isValid() const override; protected: - WindowPixmap *createChild(const QPointer &subSurface) override; + WindowPixmap *createChild(const QPointer &subSurface) override; private: - explicit OpenGLWindowPixmap(const QPointer &subSurface, WindowPixmap *parent, SceneOpenGL *scene); + explicit OpenGLWindowPixmap(const QPointer &subSurface, WindowPixmap *parent, SceneOpenGL *scene); QScopedPointer m_texture; SceneOpenGL *m_scene; }; diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -49,9 +49,9 @@ #include "decorations/decoratedclient.h" #include -#include -#include -#include +#include +#include +#include #include #include @@ -1534,7 +1534,7 @@ { } -OpenGLWindowPixmap::OpenGLWindowPixmap(const QPointer &subSurface, WindowPixmap *parent, SceneOpenGL *scene) +OpenGLWindowPixmap::OpenGLWindowPixmap(const QPointer &subSurface, WindowPixmap *parent, SceneOpenGL *scene) : WindowPixmap(subSurface, parent) , m_texture(scene->createTexture()) , m_scene(scene) @@ -1610,7 +1610,7 @@ return success; } -WindowPixmap *OpenGLWindowPixmap::createChild(const QPointer &subSurface) +WindowPixmap *OpenGLWindowPixmap::createChild(const QPointer &subSurface) { return new OpenGLWindowPixmap(subSurface, this, m_scene); } diff --git a/plugins/scenes/qpainter/scene_qpainter.h b/plugins/scenes/qpainter/scene_qpainter.h --- a/plugins/scenes/qpainter/scene_qpainter.h +++ b/plugins/scenes/qpainter/scene_qpainter.h @@ -97,9 +97,9 @@ const QImage &image(); protected: - WindowPixmap *createChild(const QPointer &subSurface) override; + WindowPixmap *createChild(const QPointer &subSurface) override; private: - explicit QPainterWindowPixmap(const QPointer &subSurface, WindowPixmap *parent); + explicit QPainterWindowPixmap(const QPointer &subSurface, WindowPixmap *parent); QImage m_image; }; diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -32,9 +32,9 @@ #include -#include -#include -#include +#include +#include +#include #include "decorations/decoratedclient.h" // Qt #include @@ -416,7 +416,7 @@ { } -QPainterWindowPixmap::QPainterWindowPixmap(const QPointer &subSurface, WindowPixmap *parent) +QPainterWindowPixmap::QPainterWindowPixmap(const QPointer &subSurface, WindowPixmap *parent) : WindowPixmap(subSurface, parent) { } @@ -446,7 +446,7 @@ } } -WindowPixmap *QPainterWindowPixmap::createChild(const QPointer &subSurface) +WindowPixmap *QPainterWindowPixmap::createChild(const QPointer &subSurface) { return new QPainterWindowPixmap(subSurface, this); } diff --git a/pointer_input.h b/pointer_input.h --- a/pointer_input.h +++ b/pointer_input.h @@ -32,13 +32,10 @@ class QWindow; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class SurfaceInterface; } -} namespace KWin { @@ -157,12 +154,12 @@ void updateToReset(); void updatePosition(const QPointF &pos); void updateButton(uint32_t button, InputRedirection::PointerButtonState state); - void warpXcbOnSurfaceLeft(KWayland::Server::SurfaceInterface *surface); + void warpXcbOnSurfaceLeft(KWaylandServer::SurfaceInterface *surface); QPointF applyPointerConfinement(const QPointF &pos) const; void disconnectConfinedPointerRegionConnection(); void disconnectLockedPointerAboutToBeUnboundConnection(); void disconnectPointerConstraintsConnection(); - void breakPointerConstraints(KWayland::Server::SurfaceInterface *surface); + void breakPointerConstraints(KWaylandServer::SurfaceInterface *surface); CursorImage *m_cursor; bool m_supportsWarping; QPointF m_pos; diff --git a/pointer_input.cpp b/pointer_input.cpp --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -36,12 +36,12 @@ // KWayland #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // screenlocker #include @@ -150,7 +150,7 @@ } connect(workspace(), &QObject::destroyed, this, [this] { setInited(false); }); connect(waylandServer(), &QObject::destroyed, this, [this] { setInited(false); }); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::dragEnded, this, + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this] { // need to force a focused pointer change waylandServer()->seat()->setFocusedPointerSurface(nullptr); @@ -587,14 +587,14 @@ } ); - m_constraintsConnection = connect(focusNow->surface(), &KWayland::Server::SurfaceInterface::pointerConstraintsChanged, + m_constraintsConnection = connect(focusNow->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged, this, &PointerInputRedirection::updatePointerConstraints); m_constraintsActivatedConnection = connect(workspace(), &Workspace::clientActivated, this, &PointerInputRedirection::updatePointerConstraints); updatePointerConstraints(); } -void PointerInputRedirection::breakPointerConstraints(KWayland::Server::SurfaceInterface *surface) +void PointerInputRedirection::breakPointerConstraints(KWaylandServer::SurfaceInterface *surface) { // cancel pointer constraints if (surface) { @@ -681,7 +681,7 @@ if (canConstrain && r.contains(m_pos.toPoint())) { cf->setConfined(true); m_confined = true; - m_confinedPointerRegionConnection = connect(cf.data(), &KWayland::Server::ConfinedPointerInterface::regionChanged, this, + m_confinedPointerRegionConnection = connect(cf.data(), &KWaylandServer::ConfinedPointerInterface::regionChanged, this, [this] { if (!focus()) { return; @@ -730,16 +730,16 @@ // The client might cancel pointer locking from its side by unbinding the LockedPointerInterface. // In this case the cached cursor position hint must be fetched before the resource goes away - m_lockedPointerAboutToBeUnboundConnection = connect(lock.data(), &KWayland::Server::LockedPointerInterface::aboutToBeUnbound, this, + m_lockedPointerAboutToBeUnboundConnection = connect(lock.data(), &KWaylandServer::LockedPointerInterface::aboutToBeUnbound, this, [this, lock]() { const auto hint = lock->cursorPositionHint(); if (hint.x() < 0 || hint.y() < 0 || !focus()) { return; } auto globalHint = focus()->pos() - focus()->clientContentPos() + hint; // When the resource finally goes away, reposition the cursor according to the hint - connect(lock.data(), &KWayland::Server::LockedPointerInterface::unbound, this, + connect(lock.data(), &KWaylandServer::LockedPointerInterface::unbound, this, [this, globalHint]() { processMotion(globalHint, waylandServer()->seat()->timestamp()); }); @@ -753,7 +753,7 @@ } } -void PointerInputRedirection::warpXcbOnSurfaceLeft(KWayland::Server::SurfaceInterface *newSurface) +void PointerInputRedirection::warpXcbOnSurfaceLeft(KWaylandServer::SurfaceInterface *newSurface) { auto xc = waylandServer()->xWaylandConnection(); if (!xc) { @@ -947,9 +947,9 @@ : QObject(parent) , m_pointer(parent) { - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::focusedPointerChanged, this, &CursorImage::update); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::dragStarted, this, &CursorImage::updateDrag); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::dragEnded, this, + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::focusedPointerChanged, this, &CursorImage::update); + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &CursorImage::updateDrag); + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this] { disconnect(m_drag.connection); reevaluteSource(); @@ -1031,7 +1031,7 @@ if (s_cursorUpdateBlocking) { return; } - using namespace KWayland::Server; + using namespace KWaylandServer; disconnect(m_serverCursor.connection); auto p = waylandServer()->seat()->focusedPointer(); if (p) { @@ -1172,7 +1172,7 @@ void CursorImage::updateDrag() { - using namespace KWayland::Server; + using namespace KWaylandServer; disconnect(m_drag.connection); m_drag.cursor = {}; reevaluteSource(); @@ -1288,7 +1288,7 @@ } waylandServer()->internalClientConection()->flush(); waylandServer()->dispatch(); - auto buffer = KWayland::Server::BufferInterface::get(waylandServer()->internalConnection()->getResource(KWayland::Client::Buffer::getId(b))); + auto buffer = KWaylandServer::BufferInterface::get(waylandServer()->internalConnection()->getResource(KWayland::Client::Buffer::getId(b))); if (!buffer) { return; } diff --git a/scene.h b/scene.h --- a/scene.h +++ b/scene.h @@ -30,14 +30,11 @@ class QOpenGLFramebufferObject; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class BufferInterface; class SubSurfaceInterface; } -} namespace KWin { @@ -429,7 +426,7 @@ /** * @return The Wayland BufferInterface for this WindowPixmap. */ - QPointer buffer() const; + QPointer buffer() const; const QSharedPointer &fbo() const; QImage internalImage() const; /** @@ -480,19 +477,19 @@ /** * @returns the subsurface this WindowPixmap is for if it is not for a root window */ - QPointer subSurface() const { + QPointer subSurface() const { return m_subSurface; } /** * @returns the surface this WindowPixmap references, might be @c null. */ - KWayland::Server::SurfaceInterface *surface() const; + KWaylandServer::SurfaceInterface *surface() const; protected: explicit WindowPixmap(Scene::Window *window); - explicit WindowPixmap(const QPointer &subSurface, WindowPixmap *parent); - virtual WindowPixmap *createChild(const QPointer &subSurface); + explicit WindowPixmap(const QPointer &subSurface, WindowPixmap *parent); + virtual WindowPixmap *createChild(const QPointer &subSurface); /** * @return The Window this WindowPixmap belongs to */ @@ -517,12 +514,12 @@ QSize m_pixmapSize; bool m_discarded; QRect m_contentsRect; - QPointer m_buffer; + QPointer m_buffer; QSharedPointer m_fbo; QImage m_internalImage; WindowPixmap *m_parent = nullptr; QVector m_children; - QPointer m_subSurface; + QPointer m_subSurface; }; class Scene::EffectFrame @@ -615,7 +612,7 @@ } inline -QPointer WindowPixmap::buffer() const +QPointer WindowPixmap::buffer() const { return m_buffer; } diff --git a/scene.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -81,9 +81,9 @@ #include "thumbnailitem.h" -#include -#include -#include +#include +#include +#include namespace KWin { @@ -393,7 +393,7 @@ connect(c, SIGNAL(windowClosed(KWin::Toplevel*,KWin::Deleted*)), SLOT(windowClosed(KWin::Toplevel*,KWin::Deleted*))); //A change of scale won't affect the geometry in compositor co-ordinates, but will affect the window quads. if (c->surface()) { - connect(c->surface(), &KWayland::Server::SurfaceInterface::scaleChanged, this, std::bind(&Scene::windowGeometryShapeChanged, this, c)); + connect(c->surface(), &KWaylandServer::SurfaceInterface::scaleChanged, this, std::bind(&Scene::windowGeometryShapeChanged, this, c)); } connect(c, &Toplevel::screenScaleChanged, this, [this, c] { @@ -1028,7 +1028,7 @@ { } -WindowPixmap::WindowPixmap(const QPointer &subSurface, WindowPixmap *parent) +WindowPixmap::WindowPixmap(const QPointer &subSurface, WindowPixmap *parent) : m_window(parent->m_window) , m_pixmap(XCB_PIXMAP_NONE) , m_discarded(false) @@ -1045,7 +1045,7 @@ xcb_free_pixmap(connection(), m_pixmap); } if (m_buffer) { - using namespace KWayland::Server; + using namespace KWaylandServer; QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); m_buffer->unref(); } @@ -1094,7 +1094,7 @@ m_window->unreferencePreviousPixmap(); } -WindowPixmap *WindowPixmap::createChild(const QPointer &subSurface) +WindowPixmap *WindowPixmap::createChild(const QPointer &subSurface) { Q_UNUSED(subSurface) return nullptr; @@ -1110,11 +1110,11 @@ void WindowPixmap::updateBuffer() { - using namespace KWayland::Server; + using namespace KWaylandServer; if (SurfaceInterface *s = surface()) { QVector oldTree = m_children; QVector children; - using namespace KWayland::Server; + using namespace KWaylandServer; const auto subSurfaces = s->childSubSurfaces(); for (const auto &subSurface : subSurfaces) { if (subSurface.isNull()) { @@ -1167,7 +1167,7 @@ } } -KWayland::Server::SurfaceInterface *WindowPixmap::surface() const +KWaylandServer::SurfaceInterface *WindowPixmap::surface() const { if (!m_subSurface.isNull()) { return m_subSurface->surface().data(); diff --git a/shadow.h b/shadow.h --- a/shadow.h +++ b/shadow.h @@ -31,13 +31,10 @@ class DecorationShadow; } -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class ShadowInterface; } -} namespace KWin { @@ -173,7 +170,7 @@ static QVector readX11ShadowProperty(xcb_window_t id); bool init(const QVector &data); bool init(KDecoration2::Decoration *decoration); - bool init(const QPointer &shadow); + bool init(const QPointer &shadow); bool init(const QWindow *window); Toplevel *m_topLevel; // shadow pixmaps diff --git a/shadow.cpp b/shadow.cpp --- a/shadow.cpp +++ b/shadow.cpp @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -239,7 +239,7 @@ return true; } -bool Shadow::init(const QPointer< KWayland::Server::ShadowInterface > &shadow) +bool Shadow::init(const QPointer< KWaylandServer::ShadowInterface > &shadow) { if (!shadow) { return false; diff --git a/tablet_input.cpp b/tablet_input.cpp --- a/tablet_input.cpp +++ b/tablet_input.cpp @@ -31,7 +31,7 @@ // KDecoration #include // KWayland -#include +#include // screenlocker #include // Qt diff --git a/toplevel.h b/toplevel.h --- a/toplevel.h +++ b/toplevel.h @@ -40,13 +40,10 @@ class QOpenGLFramebufferObject; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class SurfaceInterface; } -} namespace KWin { @@ -279,7 +276,7 @@ * Interface to the Wayland Surface. * Relevant only in Wayland, in X11 it will be nullptr */ - Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) + Q_PROPERTY(KWaylandServer::SurfaceInterface *surface READ surface) /** * Whether the window is a popup. @@ -517,8 +514,8 @@ void setSkipCloseAnimation(bool set); quint32 surfaceId() const; - KWayland::Server::SurfaceInterface *surface() const; - void setSurface(KWayland::Server::SurfaceInterface *surface); + KWaylandServer::SurfaceInterface *surface() const; + void setSurface(KWaylandServer::SurfaceInterface *surface); const QSharedPointer &internalFramebufferObject() const; QImage internalImageObject() const; @@ -741,7 +738,7 @@ int m_screen; bool m_skipCloseAnimation; quint32 m_surfaceId = 0; - KWayland::Server::SurfaceInterface *m_surface = nullptr; + KWaylandServer::SurfaceInterface *m_surface = nullptr; // when adding new data members, check also copyToDeleted() qreal m_screenScale = 1.0; }; @@ -998,7 +995,7 @@ return m_surfaceId; } -inline KWayland::Server::SurfaceInterface *Toplevel::surface() const +inline KWaylandServer::SurfaceInterface *Toplevel::surface() const { return m_surface; } diff --git a/toplevel.cpp b/toplevel.cpp --- a/toplevel.cpp +++ b/toplevel.cpp @@ -31,7 +31,7 @@ #include "workspace.h" #include "xcbutils.h" -#include +#include #include @@ -699,12 +699,12 @@ emit skipCloseAnimationChanged(); } -void Toplevel::setSurface(KWayland::Server::SurfaceInterface *surface) +void Toplevel::setSurface(KWaylandServer::SurfaceInterface *surface) { if (m_surface == surface) { return; } - using namespace KWayland::Server; + using namespace KWaylandServer; if (m_surface) { disconnect(m_surface, &SurfaceInterface::damaged, this, &Toplevel::addDamage); disconnect(m_surface, &SurfaceInterface::sizeChanged, this, &Toplevel::discardWindowPixmap); diff --git a/touch_input.cpp b/touch_input.cpp --- a/touch_input.cpp +++ b/touch_input.cpp @@ -30,7 +30,7 @@ // KDecoration #include // KWayland -#include +#include // screenlocker #include // Qt @@ -116,7 +116,7 @@ // TODO: invalidate pointer focus? - // FIXME: add input transformation API to KWayland::Server::SeatInterface for touch input + // FIXME: add input transformation API to KWaylandServer::SeatInterface for touch input seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos()); m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this, [this] { diff --git a/virtualdesktops.h b/virtualdesktops.h --- a/virtualdesktops.h +++ b/virtualdesktops.h @@ -36,13 +36,10 @@ class NETRootInfo; class QAction; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class PlasmaVirtualDesktopManagementInterface; } -} namespace KWin { @@ -164,7 +161,7 @@ /** * @internal, for Wayland case */ - void setVirtualDesktopManagement(KWayland::Server::PlasmaVirtualDesktopManagementInterface *management); + void setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management); /** * @internal */ @@ -492,7 +489,7 @@ VirtualDesktopGrid m_grid; // TODO: QPointer NETRootInfo *m_rootInfo; - KWayland::Server::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; + KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; KSharedConfig::Ptr m_config; KWIN_SINGLETON_VARIABLE(VirtualDesktopManager, s_manager) diff --git a/virtualdesktops.cpp b/virtualdesktops.cpp --- a/virtualdesktops.cpp +++ b/virtualdesktops.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include // Qt #include #include @@ -53,9 +53,9 @@ emit aboutToBeDestroyed(); } -void VirtualDesktopManager::setVirtualDesktopManagement(KWayland::Server::PlasmaVirtualDesktopManagementInterface *management) +void VirtualDesktopManager::setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management) { - using namespace KWayland::Server; + using namespace KWaylandServer; Q_ASSERT(!m_virtualDesktopManagement); m_virtualDesktopManagement = management; diff --git a/virtualkeyboard.cpp b/virtualkeyboard.cpp --- a/virtualkeyboard.cpp +++ b/virtualkeyboard.cpp @@ -28,10 +28,10 @@ #include "xkb.h" #include "screenlockerwatcher.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -50,7 +50,7 @@ // xkbcommon #include -using namespace KWayland::Server; +using namespace KWaylandServer; namespace KWin { diff --git a/wayland_cursor_theme.cpp b/wayland_cursor_theme.cpp --- a/wayland_cursor_theme.cpp +++ b/wayland_cursor_theme.cpp @@ -25,8 +25,8 @@ #include // KWayland #include -#include -#include +#include +#include // Wayland #include diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -41,7 +41,8 @@ class ShmPool; class Surface; } -namespace Server +} +namespace KWaylandServer { class AppMenuManagerInterface; class ClientConnection; @@ -71,7 +72,7 @@ class LinuxDmabufUnstableV1Buffer; class TabletManagerInterface; } -} + namespace KWin { @@ -97,48 +98,48 @@ bool init(const QByteArray &socketName = QByteArray(), InitializationFlags flags = InitializationFlag::NoOptions); void terminateClientConnections(); - KWayland::Server::Display *display() { + KWaylandServer::Display *display() { return m_display; } - KWayland::Server::CompositorInterface *compositor() { + KWaylandServer::CompositorInterface *compositor() { return m_compositor; } - KWayland::Server::SeatInterface *seat() { + KWaylandServer::SeatInterface *seat() { return m_seat; } - KWayland::Server::TabletManagerInterface *tabletManager() + KWaylandServer::TabletManagerInterface *tabletManager() { return m_tabletManager; } - KWayland::Server::DataDeviceManagerInterface *dataDeviceManager() { + KWaylandServer::DataDeviceManagerInterface *dataDeviceManager() { return m_dataDeviceManager; } - KWayland::Server::PlasmaVirtualDesktopManagementInterface *virtualDesktopManagement() { + KWaylandServer::PlasmaVirtualDesktopManagementInterface *virtualDesktopManagement() { return m_virtualDesktopManagement; } - KWayland::Server::PlasmaWindowManagementInterface *windowManagement() { + KWaylandServer::PlasmaWindowManagementInterface *windowManagement() { return m_windowManagement; } - KWayland::Server::ServerSideDecorationManagerInterface *decorationManager() const { + KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const { return m_decorationManager; } - KWayland::Server::XdgOutputManagerInterface *xdgOutputManager() const { + KWaylandServer::XdgOutputManagerInterface *xdgOutputManager() const { return m_xdgOutputManager; } - KWayland::Server::LinuxDmabufUnstableV1Interface *linuxDmabuf(); + KWaylandServer::LinuxDmabufUnstableV1Interface *linuxDmabuf(); QList clients() const { return m_clients; } void removeClient(AbstractClient *c); AbstractClient *findClient(quint32 id) const; - AbstractClient *findClient(KWayland::Server::SurfaceInterface *surface) const; - XdgShellClient *findXdgShellClient(KWayland::Server::SurfaceInterface *surface) const; + AbstractClient *findClient(KWaylandServer::SurfaceInterface *surface) const; + XdgShellClient *findXdgShellClient(KWaylandServer::SurfaceInterface *surface) const; /** * @returns a transient parent of a surface imported with the foreign protocol, if any */ - KWayland::Server::SurfaceInterface *findForeignTransientForSurface(KWayland::Server::SurfaceInterface *surface); + KWaylandServer::SurfaceInterface *findForeignTransientForSurface(KWaylandServer::SurfaceInterface *surface); /** * @returns file descriptor for Xwayland to connect to. @@ -169,16 +170,16 @@ void createInternalConnection(); void initWorkspace(); - KWayland::Server::ClientConnection *xWaylandConnection() const { + KWaylandServer::ClientConnection *xWaylandConnection() const { return m_xwayland.client; } - KWayland::Server::ClientConnection *inputMethodConnection() const { + KWaylandServer::ClientConnection *inputMethodConnection() const { return m_inputMethodServerConnection; } - KWayland::Server::ClientConnection *internalConnection() const { + KWaylandServer::ClientConnection *internalConnection() const { return m_internalConnection.server; } - KWayland::Server::ClientConnection *screenLockerClientConnection() const { + KWaylandServer::ClientConnection *screenLockerClientConnection() const { return m_screenLockerClientConnection; } KWayland::Client::Compositor *internalCompositor() { @@ -200,7 +201,7 @@ return m_internalConnection.registry; } void dispatch(); - quint32 createWindowId(KWayland::Server::SurfaceInterface *surface); + quint32 createWindowId(KWaylandServer::SurfaceInterface *surface); /** * Struct containing information for a created Wayland connection through a @@ -210,7 +211,7 @@ /** * ServerSide Connection */ - KWayland::Server::ClientConnection *connection = nullptr; + KWaylandServer::ClientConnection *connection = nullptr; /** * client-side file descriptor for the socket */ @@ -224,57 +225,57 @@ void simulateUserActivity(); void updateKeyState(KWin::Xkb::LEDs leds); - QSet linuxDmabufBuffers() const { + QSet linuxDmabufBuffers() const { return m_linuxDmabufBuffers; } - void addLinuxDmabufBuffer(KWayland::Server::LinuxDmabufUnstableV1Buffer *buffer) { + void addLinuxDmabufBuffer(KWaylandServer::LinuxDmabufUnstableV1Buffer *buffer) { m_linuxDmabufBuffers << buffer; } - void removeLinuxDmabufBuffer(KWayland::Server::LinuxDmabufUnstableV1Buffer *buffer) { + void removeLinuxDmabufBuffer(KWaylandServer::LinuxDmabufUnstableV1Buffer *buffer) { m_linuxDmabufBuffers.remove(buffer); } Q_SIGNALS: void shellClientAdded(KWin::AbstractClient *); void shellClientRemoved(KWin::AbstractClient *); void terminatingInternalClientConnection(); void initialized(); - void foreignTransientChanged(KWayland::Server::SurfaceInterface *child); + void foreignTransientChanged(KWaylandServer::SurfaceInterface *child); private: int createScreenLockerConnection(); void shellClientShown(Toplevel *t); - quint16 createClientId(KWayland::Server::ClientConnection *c); + quint16 createClientId(KWaylandServer::ClientConnection *c); void destroyInternalConnection(); template void createSurface(T *surface); void initScreenLocker(); - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::CompositorInterface *m_compositor = nullptr; - KWayland::Server::SeatInterface *m_seat = nullptr; - KWayland::Server::TabletManagerInterface *m_tabletManager = nullptr; - KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManager = nullptr; - KWayland::Server::XdgShellInterface *m_xdgShell = nullptr; - KWayland::Server::PlasmaShellInterface *m_plasmaShell = nullptr; - KWayland::Server::PlasmaWindowManagementInterface *m_windowManagement = nullptr; - KWayland::Server::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; - KWayland::Server::ServerSideDecorationManagerInterface *m_decorationManager = nullptr; - KWayland::Server::OutputManagementInterface *m_outputManagement = nullptr; - KWayland::Server::AppMenuManagerInterface *m_appMenuManager = nullptr; - KWayland::Server::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; - KWayland::Server::IdleInterface *m_idle = nullptr; - KWayland::Server::XdgOutputManagerInterface *m_xdgOutputManager = nullptr; - KWayland::Server::XdgDecorationManagerInterface *m_xdgDecorationManager = nullptr; - KWayland::Server::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr; - QSet m_linuxDmabufBuffers; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::CompositorInterface *m_compositor = nullptr; + KWaylandServer::SeatInterface *m_seat = nullptr; + KWaylandServer::TabletManagerInterface *m_tabletManager = nullptr; + KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManager = nullptr; + KWaylandServer::XdgShellInterface *m_xdgShell = nullptr; + KWaylandServer::PlasmaShellInterface *m_plasmaShell = nullptr; + KWaylandServer::PlasmaWindowManagementInterface *m_windowManagement = nullptr; + KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; + KWaylandServer::ServerSideDecorationManagerInterface *m_decorationManager = nullptr; + KWaylandServer::OutputManagementInterface *m_outputManagement = nullptr; + KWaylandServer::AppMenuManagerInterface *m_appMenuManager = nullptr; + KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; + KWaylandServer::IdleInterface *m_idle = nullptr; + KWaylandServer::XdgOutputManagerInterface *m_xdgOutputManager = nullptr; + KWaylandServer::XdgDecorationManagerInterface *m_xdgDecorationManager = nullptr; + KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr; + QSet m_linuxDmabufBuffers; struct { - KWayland::Server::ClientConnection *client = nullptr; + KWaylandServer::ClientConnection *client = nullptr; QMetaObject::Connection destroyConnection; } m_xwayland; - KWayland::Server::ClientConnection *m_inputMethodServerConnection = nullptr; - KWayland::Server::ClientConnection *m_screenLockerClientConnection = nullptr; + KWaylandServer::ClientConnection *m_inputMethodServerConnection = nullptr; + KWaylandServer::ClientConnection *m_screenLockerClientConnection = nullptr; struct { - KWayland::Server::ClientConnection *server = nullptr; + KWaylandServer::ClientConnection *server = nullptr; KWayland::Client::ConnectionThread *client = nullptr; QThread *clientThread = nullptr; KWayland::Client::Registry *registry = nullptr; @@ -285,12 +286,12 @@ bool interfacesAnnounced = false; } m_internalConnection; - KWayland::Server::XdgForeignInterface *m_XdgForeign = nullptr; - KWayland::Server::KeyStateInterface *m_keyState = nullptr; + KWaylandServer::XdgForeignInterface *m_XdgForeign = nullptr; + KWaylandServer::KeyStateInterface *m_keyState = nullptr; QList m_clients; - QHash m_clientIds; + QHash m_clientIds; InitializationFlags m_initFlags; - QVector m_plasmaShellSurfaces; + QVector m_plasmaShellSurfaces; KWIN_SINGLETON(WaylandServer) }; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -36,36 +36,36 @@ #include #include // Server -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KF #include @@ -85,7 +85,7 @@ //screenlocker #include -using namespace KWayland::Server; +using namespace KWaylandServer; namespace KWin { @@ -95,7 +95,7 @@ WaylandServer::WaylandServer(QObject *parent) : QObject(parent) { - qRegisterMetaType(); + qRegisterMetaType(); } WaylandServer::~WaylandServer() @@ -185,16 +185,16 @@ } //not directly connected as the connection is tied to client instead of this - connect(m_XdgForeign, &KWayland::Server::XdgForeignInterface::transientChanged, client, [this](KWayland::Server::SurfaceInterface *child) { + connect(m_XdgForeign, &KWaylandServer::XdgForeignInterface::transientChanged, client, [this](KWaylandServer::SurfaceInterface *child) { emit foreignTransientChanged(child); }); } -class KWinDisplay : public KWayland::Server::FilteredDisplay +class KWinDisplay : public KWaylandServer::FilteredDisplay { public: KWinDisplay(QObject *parent) - : KWayland::Server::FilteredDisplay(parent) + : KWaylandServer::FilteredDisplay(parent) {} static QByteArray sha256(const QString &fileName) @@ -209,7 +209,7 @@ return QByteArray(); } - bool isTrustedOrigin(KWayland::Server::ClientConnection *client) const { + bool isTrustedOrigin(KWaylandServer::ClientConnection *client) const { const auto fullPathSha = sha256(client->executablePath()); const auto localSha = sha256(QLatin1String("/proc/") + QString::number(client->processId()) + QLatin1String("/exe")); const bool trusted = !localSha.isEmpty() && fullPathSha == localSha; @@ -221,7 +221,7 @@ return trusted; } - QStringList fetchRequestedInterfaces(KWayland::Server::ClientConnection *client) const { + QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { const auto serviceQuery = QStringLiteral("exist Exec and exist [X-KDE-Wayland-Interfaces] and '%1' =~ Exec").arg(client->executablePath()); const auto servicesFound = KServiceTypeTrader::self()->query(QStringLiteral("Application"), serviceQuery); @@ -237,7 +237,7 @@ QSet interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; - bool allowInterface(KWayland::Server::ClientConnection *client, const QByteArray &interfaceName) override { + bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { if (client->processId() == getpid()) { return true; } @@ -431,7 +431,7 @@ m_outputManagement = m_display->createOutputManagement(m_display); connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, - this, [](KWayland::Server::OutputConfigurationInterface *config) { + this, [](KWaylandServer::OutputConfigurationInterface *config) { kwinApp()->platform()->requestOutputsChange(config); }); m_outputManagement->create(); @@ -450,7 +450,7 @@ return true; } -KWayland::Server::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() +KWaylandServer::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() { if (!m_linuxDmabuf) { m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); @@ -482,7 +482,7 @@ if (m_windowManagement) { connect(workspace(), &Workspace::showingDesktopChanged, this, [this] (bool set) { - using namespace KWayland::Server; + using namespace KWaylandServer; m_windowManagement->setShowingDesktopState(set ? PlasmaWindowManagementInterface::ShowingDesktopState::Enabled : PlasmaWindowManagementInterface::ShowingDesktopState::Disabled @@ -537,7 +537,7 @@ ScreenLocker::KSldApp::self()->setWaylandFd(clientFd); for (auto *seat : m_display->seats()) { - connect(seat, &KWayland::Server::SeatInterface::timestampChanged, + connect(seat, &KWaylandServer::SeatInterface::timestampChanged, screenLockerApp, &ScreenLocker::KSldApp::userActivity); } } @@ -552,7 +552,7 @@ } for (auto *seat : m_display->seats()) { - disconnect(seat, &KWayland::Server::SeatInterface::timestampChanged, + disconnect(seat, &KWaylandServer::SeatInterface::timestampChanged, screenLockerApp, &ScreenLocker::KSldApp::userActivity); } ScreenLocker::KSldApp::self()->setWaylandFd(-1); @@ -585,7 +585,7 @@ return -1; } m_screenLockerClientConnection = socket.connection; - connect(m_screenLockerClientConnection, &KWayland::Server::ClientConnection::disconnected, + connect(m_screenLockerClientConnection, &KWaylandServer::ClientConnection::disconnected, this, [this] { m_screenLockerClientConnection = nullptr; }); return socket.fd; } @@ -597,7 +597,7 @@ return -1; } m_xwayland.client = socket.connection; - m_xwayland.destroyConnection = connect(m_xwayland.client, &KWayland::Server::ClientConnection::disconnected, this, + m_xwayland.destroyConnection = connect(m_xwayland.client, &KWaylandServer::ClientConnection::disconnected, this, [] { qFatal("Xwayland Connection died"); } @@ -715,7 +715,7 @@ return *it; } -static AbstractClient *findClientInList(const QList &clients, KWayland::Server::SurfaceInterface *surface) +static AbstractClient *findClientInList(const QList &clients, KWaylandServer::SurfaceInterface *surface) { auto it = std::find_if(clients.begin(), clients.end(), [surface] (AbstractClient *c) { diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -24,19 +24,16 @@ #include "abstract_client.h" -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class ServerSideDecorationInterface; class ServerSideDecorationPaletteInterface; class AppMenuInterface; class PlasmaShellSurfaceInterface; class XdgDecorationInterface; } -} namespace KWin { @@ -54,8 +51,8 @@ Q_OBJECT public: - XdgShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); - XdgShellClient(KWayland::Server::XdgShellPopupInterface *surface); + XdgShellClient(KWaylandServer::XdgShellSurfaceInterface *surface); + XdgShellClient(KWaylandServer::XdgShellPopupInterface *surface); ~XdgShellClient() override; QRect inputGeometry() const override; @@ -121,11 +118,11 @@ bool supportsWindowRules() const override; void destroyClient() override; - void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); - void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); - void installAppMenu(KWayland::Server::AppMenuInterface *appmenu); - void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); - void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); + void installPlasmaShellSurface(KWaylandServer::PlasmaShellSurfaceInterface *surface); + void installServerSideDecoration(KWaylandServer::ServerSideDecorationInterface *decoration); + void installAppMenu(KWaylandServer::AppMenuInterface *appmenu); + void installPalette(KWaylandServer::ServerSideDecorationPaletteInterface *palette); + void installXdgDecoration(KWaylandServer::XdgDecorationInterface *decoration); protected: void addDamage(const QRegion &damage) override; @@ -146,13 +143,13 @@ void handleWindowClassChanged(const QByteArray &windowClass); void handleWindowGeometryChanged(const QRect &windowGeometry); void handleWindowTitleChanged(const QString &title); - void handleMoveRequested(KWayland::Server::SeatInterface *seat, quint32 serial); - void handleResizeRequested(KWayland::Server::SeatInterface *seat, quint32 serial, Qt::Edges edges); + void handleMoveRequested(KWaylandServer::SeatInterface *seat, quint32 serial); + void handleResizeRequested(KWaylandServer::SeatInterface *seat, quint32 serial, Qt::Edges edges); void handleMinimizeRequested(); void handleMaximizeRequested(bool maximized); - void handleFullScreenRequested(bool fullScreen, KWayland::Server::OutputInterface *output); - void handleWindowMenuRequested(KWayland::Server::SeatInterface *seat, quint32 serial, const QPoint &surfacePos); - void handleGrabRequested(KWayland::Server::SeatInterface *seat, quint32 serial); + void handleFullScreenRequested(bool fullScreen, KWaylandServer::OutputInterface *output); + void handleWindowMenuRequested(KWaylandServer::SeatInterface *seat, quint32 serial, const QPoint &surfacePos); + void handleGrabRequested(KWaylandServer::SeatInterface *seat, quint32 serial); void handlePingDelayed(quint32 serial); void handlePingTimeout(quint32 serial); void handlePongReceived(quint32 serial); @@ -172,7 +169,7 @@ void updateIcon(); bool shouldExposeToWindowManagement(); void updateClientOutputs(); - KWayland::Server::XdgShellSurfaceInterface::States xdgSurfaceStates() const; + KWaylandServer::XdgShellSurfaceInterface::States xdgSurfaceStates() const; void updateShowOnScreenEdge(); void updateMaximizeMode(MaximizeMode maximizeMode); // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest @@ -189,8 +186,8 @@ QRect adjustMoveGeometry(const QRect &rect) const; QRect adjustResizeGeometry(const QRect &rect) const; - KWayland::Server::XdgShellSurfaceInterface *m_xdgShellToplevel; - KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; + KWaylandServer::XdgShellSurfaceInterface *m_xdgShellToplevel; + KWaylandServer::XdgShellPopupInterface *m_xdgShellPopup; QRect m_bufferGeometry; QRect m_windowGeometry; @@ -221,11 +218,11 @@ quint32 m_windowId = 0; bool m_unmapped = true; NET::WindowType m_windowType = NET::Normal; - QPointer m_plasmaShellSurface; - QPointer m_appMenuInterface; - QPointer m_paletteInterface; - KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; - KWayland::Server::XdgDecorationInterface *m_xdgDecoration = nullptr; + QPointer m_plasmaShellSurface; + QPointer m_appMenuInterface; + QPointer m_paletteInterface; + KWaylandServer::ServerSideDecorationInterface *m_serverDecoration = nullptr; + KWaylandServer::XdgDecorationInterface *m_xdgDecoration = nullptr; bool m_userNoBorder = false; bool m_fullScreen = false; bool m_transient = false; diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -36,19 +36,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -59,7 +59,7 @@ Q_DECLARE_METATYPE(NET::WindowType) -using namespace KWayland::Server; +using namespace KWaylandServer; namespace KWin { @@ -168,7 +168,7 @@ updateShadow(); connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::updateShadow); - connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) { + connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWaylandServer::SurfaceInterface *child) { if (child == surface()) { handleTransientForChanged(); } @@ -455,7 +455,7 @@ } else destroyDecoration(); if (m_serverDecoration && isDecorated()) { - m_serverDecoration->setMode(KWayland::Server::ServerSideDecorationManagerInterface::Mode::Server); + m_serverDecoration->setMode(KWaylandServer::ServerSideDecorationManagerInterface::Mode::Server); } if (m_xdgDecoration) { auto mode = isDecorated() || m_userNoBorder ? XdgDecorationInterface::Mode::ServerSide: XdgDecorationInterface::Mode::ClientSide; @@ -1791,7 +1791,7 @@ return matrix; } -void XdgShellClient::installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *deco) +void XdgShellClient::installServerSideDecoration(KWaylandServer::ServerSideDecorationInterface *deco) { if (m_serverDecoration == deco) { return; @@ -1856,7 +1856,7 @@ return true; } -KWayland::Server::XdgShellSurfaceInterface::States XdgShellClient::xdgSurfaceStates() const +KWaylandServer::XdgShellSurfaceInterface::States XdgShellClient::xdgSurfaceStates() const { XdgShellSurfaceInterface::States states; if (isActive()) { diff --git a/xkb.h b/xkb.h --- a/xkb.h +++ b/xkb.h @@ -38,13 +38,10 @@ typedef uint32_t xkb_keysym_t; typedef uint32_t xkb_layout_index_t; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class SeatInterface; } -} namespace KWin { @@ -112,7 +109,7 @@ */ void forwardModifiers(); - void setSeat(KWayland::Server::SeatInterface *seat); + void setSeat(KWaylandServer::SeatInterface *seat); Q_SIGNALS: void ledsChanged(const LEDs &leds); @@ -162,7 +159,7 @@ }; Ownership m_ownership = Ownership::Server; - QPointer m_seat; + QPointer m_seat; }; inline diff --git a/xkb.cpp b/xkb.cpp --- a/xkb.cpp +++ b/xkb.cpp @@ -23,7 +23,7 @@ // frameworks #include // KWayland -#include +#include // Qt #include #include @@ -573,9 +573,9 @@ return xkb_keymap_num_layouts(m_keymap); } -void Xkb::setSeat(KWayland::Server::SeatInterface *seat) +void Xkb::setSeat(KWaylandServer::SeatInterface *seat) { - m_seat = QPointer(seat); + m_seat = QPointer(seat); } } diff --git a/xwl/clipboard.h b/xwl/clipboard.h --- a/xwl/clipboard.h +++ b/xwl/clipboard.h @@ -22,13 +22,10 @@ #include "selection.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class DataDeviceInterface; } -} namespace KWin { @@ -52,7 +49,7 @@ /** * React to Wl selection change. */ - void wlSelectionChanged(KWayland::Server::DataDeviceInterface *ddi); + void wlSelectionChanged(KWaylandServer::DataDeviceInterface *ddi); /** * Check the current state of the selection and if a source needs * to be created or destroyed. diff --git a/xwl/clipboard.cpp b/xwl/clipboard.cpp --- a/xwl/clipboard.cpp +++ b/xwl/clipboard.cpp @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -67,11 +67,11 @@ registerXfixes(); xcb_flush(xcbConn); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::selectionChanged, + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged, this, &Clipboard::wlSelectionChanged); } -void Clipboard::wlSelectionChanged(KWayland::Server::DataDeviceInterface *ddi) +void Clipboard::wlSelectionChanged(KWaylandServer::DataDeviceInterface *ddi) { if (ddi && ddi != DataBridge::self()->dataDeviceIface()) { // Wayland native client provides new selection @@ -130,7 +130,7 @@ if (dsi) { wls->setDataSourceIface(dsi); } - connect(ddi, &KWayland::Server::DataDeviceInterface::selectionChanged, + connect(ddi, &KWaylandServer::DataDeviceInterface::selectionChanged, wls, &WlSource::setDataSourceIface); ownSelection(true); } diff --git a/xwl/databridge.h b/xwl/databridge.h --- a/xwl/databridge.h +++ b/xwl/databridge.h @@ -33,12 +33,12 @@ { class DataDevice; } -namespace Server +} +namespace KWaylandServer { class DataDeviceInterface; class SurfaceInterface; } -} namespace KWin { @@ -74,7 +74,7 @@ { return m_dataDevice; } - KWayland::Server::DataDeviceInterface *dataDeviceIface() const + KWaylandServer::DataDeviceInterface *dataDeviceIface() const { return m_dataDeviceInterface; } @@ -93,7 +93,7 @@ /* Internal data device interface */ KWayland::Client::DataDevice *m_dataDevice = nullptr; - KWayland::Server::DataDeviceInterface *m_dataDeviceInterface = nullptr; + KWaylandServer::DataDeviceInterface *m_dataDeviceInterface = nullptr; Q_DISABLE_COPY(DataBridge) }; diff --git a/xwl/databridge.cpp b/xwl/databridge.cpp --- a/xwl/databridge.cpp +++ b/xwl/databridge.cpp @@ -31,12 +31,12 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; namespace KWin { diff --git a/xwl/dnd.h b/xwl/dnd.h --- a/xwl/dnd.h +++ b/xwl/dnd.h @@ -30,11 +30,11 @@ { class Surface; } -namespace Server +} +namespace KWaylandServer { class SurfaceInterface; } -} namespace KWin { @@ -64,7 +64,7 @@ DragEventReply dragMoveFilter(Toplevel *target, const QPoint &pos); - KWayland::Server::SurfaceInterface *surfaceIface() const { + KWaylandServer::SurfaceInterface *surfaceIface() const { return m_surfaceIface; } KWayland::Client::Surface *surface() const { @@ -82,7 +82,7 @@ QVector m_oldDrags; KWayland::Client::Surface *m_surface; - KWayland::Server::SurfaceInterface *m_surfaceIface = nullptr; + KWaylandServer::SurfaceInterface *m_surfaceIface = nullptr; Q_DISABLE_COPY(Dnd) }; diff --git a/xwl/dnd.cpp b/xwl/dnd.cpp --- a/xwl/dnd.cpp +++ b/xwl/dnd.cpp @@ -33,8 +33,8 @@ #include #include -#include -#include +#include +#include #include @@ -80,16 +80,16 @@ 32, 1, &s_version); xcb_flush(xcbConn); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::dragStarted, this, &Dnd::startDrag); - connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::dragEnded, this, &Dnd::endDrag); + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &Dnd::startDrag); + connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &Dnd::endDrag); const auto *comp = waylandServer()->compositor(); m_surface = waylandServer()->internalCompositor()->createSurface(this); m_surface->setInputRegion(nullptr); m_surface->commit(KWayland::Client::Surface::CommitFlag::None); auto *dc = new QMetaObject::Connection(); - *dc = connect(comp, &KWayland::Server::CompositorInterface::surfaceCreated, this, - [this, dc](KWayland::Server::SurfaceInterface *si) { + *dc = connect(comp, &KWaylandServer::CompositorInterface::surfaceCreated, this, + [this, dc](KWaylandServer::SurfaceInterface *si) { // TODO: how to make sure that it is the iface of m_surface? if (m_surfaceIface || si->client() != waylandServer()->internalConnection()) { return; diff --git a/xwl/drag_wl.h b/xwl/drag_wl.h --- a/xwl/drag_wl.h +++ b/xwl/drag_wl.h @@ -34,13 +34,13 @@ { class Surface; } -namespace Server +} +namespace KWaylandServer { class DataDeviceInterface; class DataSourceInterface; class SurfaceInterface; } -} namespace KWin { @@ -67,12 +67,12 @@ bool end() override; - KWayland::Server::DataSourceInterface *dataSourceIface() const { + KWaylandServer::DataSourceInterface *dataSourceIface() const { return m_dsi; } private: - KWayland::Server::DataSourceInterface *m_dsi; + KWaylandServer::DataSourceInterface *m_dsi; Xvisit *m_visit = nullptr; Q_DISABLE_COPY(WlToXDrag) diff --git a/xwl/drag_wl.cpp b/xwl/drag_wl.cpp --- a/xwl/drag_wl.cpp +++ b/xwl/drag_wl.cpp @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -278,7 +278,7 @@ // proxy future pointer position changes m_motionConnection = connect(waylandServer()->seat(), - &KWayland::Server::SeatInterface::pointerPosChanged, + &KWaylandServer::SeatInterface::pointerPosChanged, this, &Xvisit::sendPosition); } diff --git a/xwl/drag_x.h b/xwl/drag_x.h --- a/xwl/drag_x.h +++ b/xwl/drag_x.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/xwl/drag_x.cpp b/xwl/drag_x.cpp --- a/xwl/drag_x.cpp +++ b/xwl/drag_x.cpp @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -115,15 +115,15 @@ source->setDataSource(m_dataSource); auto *dc = new QMetaObject::Connection(); - *dc = connect(waylandServer()->dataDeviceManager(), &KWayland::Server::DataDeviceManagerInterface::dataSourceCreated, this, - [this, dc](KWayland::Server::DataSourceInterface *dsi) { + *dc = connect(waylandServer()->dataDeviceManager(), &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated, this, + [this, dc](KWaylandServer::DataSourceInterface *dsi) { Q_ASSERT(dsi); if (dsi->client() != waylandServer()->internalConnection()) { return; } QObject::disconnect(*dc); delete dc; - connect(dsi, &KWayland::Server::DataSourceInterface::mimeTypeOffered, this, &XToWlDrag::offerCallback); + connect(dsi, &KWaylandServer::DataSourceInterface::mimeTypeOffered, this, &XToWlDrag::offerCallback); } ); // Start drag with serial of last left pointer button press. diff --git a/xwl/selection_source.h b/xwl/selection_source.h --- a/xwl/selection_source.h +++ b/xwl/selection_source.h @@ -36,12 +36,12 @@ { class DataSource; } -namespace Server +} +namespace KWaylandServer { class DataDeviceInterface; class DataSourceInterface; } -} namespace KWin { @@ -93,8 +93,8 @@ Q_OBJECT public: - WlSource(Selection *selection, KWayland::Server::DataDeviceInterface *ddi); - void setDataSourceIface(KWayland::Server::DataSourceInterface *dsi); + WlSource(Selection *selection, KWaylandServer::DataDeviceInterface *ddi); + void setDataSourceIface(KWaylandServer::DataSourceInterface *dsi); bool handleSelectionRequest(xcb_selection_request_event_t *event); void sendTargets(xcb_selection_request_event_t *event); @@ -109,8 +109,8 @@ private: bool checkStartTransfer(xcb_selection_request_event_t *event); - KWayland::Server::DataDeviceInterface *m_ddi = nullptr; - KWayland::Server::DataSourceInterface *m_dsi = nullptr; + KWaylandServer::DataDeviceInterface *m_ddi = nullptr; + KWaylandServer::DataSourceInterface *m_dsi = nullptr; QVector m_offers; QMetaObject::Connection m_offerConnection; diff --git a/xwl/selection_source.cpp b/xwl/selection_source.cpp --- a/xwl/selection_source.cpp +++ b/xwl/selection_source.cpp @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -49,23 +49,23 @@ { } -WlSource::WlSource(Selection *selection, KWayland::Server::DataDeviceInterface *ddi) +WlSource::WlSource(Selection *selection, KWaylandServer::DataDeviceInterface *ddi) : SelectionSource(selection) , m_ddi(ddi) { Q_ASSERT(ddi); } -void WlSource::setDataSourceIface(KWayland::Server::DataSourceInterface *dsi) +void WlSource::setDataSourceIface(KWaylandServer::DataSourceInterface *dsi) { if (m_dsi == dsi) { return; } for (const auto &mime : dsi->mimeTypes()) { m_offers << mime; } m_offerConnection = connect(dsi, - &KWayland::Server::DataSourceInterface::mimeTypeOffered, + &KWaylandServer::DataSourceInterface::mimeTypeOffered, this, &WlSource::receiveOffer); m_dsi = dsi; } diff --git a/xwl/transfer.h b/xwl/transfer.h --- a/xwl/transfer.h +++ b/xwl/transfer.h @@ -33,11 +33,11 @@ class DataDevice; class DataSource; } -namespace Server +} +namespace KWaylandServer { class DataDeviceInterface; } -} namespace KWin { diff --git a/xwl/transfer.cpp b/xwl/transfer.cpp --- a/xwl/transfer.cpp +++ b/xwl/transfer.cpp @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include