diff --git a/src/interfaces/CMakeLists.txt b/src/interfaces/CMakeLists.txt index de396c2..c1c2328 100644 --- a/src/interfaces/CMakeLists.txt +++ b/src/interfaces/CMakeLists.txt @@ -2,8 +2,8 @@ liri_add_module(QtShellIntegration DESCRIPTION "Integration between Wayland shells and Qt applications" SOURCES - extsessionlocksurface.cpp extsessionlocksurface.h - wlrlayersurface.cpp wlrlayersurface.h wlrlayersurface_p.h + sessionlocksurface.cpp sessionlocksurface.h + layersurface.cpp layersurface.h layersurface_p.h PUBLIC_LIBRARIES Qt6::Core Qt6::Gui diff --git a/src/interfaces/declarative/qtshellintegrationplugin.cpp b/src/interfaces/declarative/qtshellintegrationplugin.cpp index c667a9a..9bf2983 100644 --- a/src/interfaces/declarative/qtshellintegrationplugin.cpp +++ b/src/interfaces/declarative/qtshellintegrationplugin.cpp @@ -4,10 +4,10 @@ #include #include -#include "../extsessionlocksurface.h" -#include "../wlrlayersurface.h" +#include "../sessionlocksurface.h" +#include "../layersurface.h" -QML_DECLARE_TYPEINFO(Liri::QtShellIntegration::WlrLayerSurface, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPEINFO(Liri::QtShellIntegration::LayerSurface, QML_HAS_ATTACHED_PROPERTIES) class Plugin : public QQmlExtensionPlugin { @@ -17,8 +17,8 @@ class Plugin : public QQmlExtensionPlugin void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("Liri.QtShellIntegration")); - qmlRegisterType(uri, 1, 0, "ExtSessionLockSurface"); - qmlRegisterType(uri, 1, 0, "WlrLayerSurface"); + qmlRegisterType(uri, 1, 0, "SessionLockSurface"); + qmlRegisterType(uri, 1, 0, "LayerSurface"); } }; diff --git a/src/interfaces/wlrlayersurface.cpp b/src/interfaces/layersurface.cpp similarity index 51% rename from src/interfaces/wlrlayersurface.cpp rename to src/interfaces/layersurface.cpp index 38e7747..40ea6d8 100644 --- a/src/interfaces/wlrlayersurface.cpp +++ b/src/interfaces/layersurface.cpp @@ -3,9 +3,9 @@ #include -#include "wlrlayersurface_p.h" +#include "layersurface_p.h" #include "qtshellintegrationlogging.h" -#include "wlrlayersurface.h" +#include "layersurface.h" namespace Liri { @@ -13,42 +13,42 @@ namespace QtShellIntegration { // Both shell integration and QML plugins will share this global // since the interface is in a dynamic library -typedef QHash WlrLayerSurfaceMap; -Q_GLOBAL_STATIC(WlrLayerSurfaceMap, globalLayerSurfaces) +typedef QHash LayerSurfaceMap; +Q_GLOBAL_STATIC(LayerSurfaceMap, globalLayerSurfaces) -WlrLayerSurface::WlrLayerSurface(QObject *parent) +LayerSurface::LayerSurface(QObject *parent) : QObject(parent) - , d_ptr(new WlrLayerSurfacePrivate()) + , d_ptr(new LayerSurfacePrivate()) { } -WlrLayerSurface::~WlrLayerSurface() +LayerSurface::~LayerSurface() { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); globalLayerSurfaces->remove(d->window); } -bool WlrLayerSurface::isInitialized() const +bool LayerSurface::isInitialized() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->initialized; } -QWindow *WlrLayerSurface::window() const +QWindow *LayerSurface::window() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->window; } -void WlrLayerSurface::setWindow(QWindow *window) +void LayerSurface::setWindow(QWindow *window) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->window == window) return; if (d->initialized) { - qCWarning(lcQtShellIntegration, "Unable to change WlrLayerSurface::window after initialization"); + qCWarning(lcQtShellIntegration, "Unable to change LayerSurface::window after initialization"); return; } @@ -59,21 +59,21 @@ void WlrLayerSurface::setWindow(QWindow *window) globalLayerSurfaces->insert(d->window, this); } -WlrLayerSurface::Layer WlrLayerSurface::layer() const +LayerSurface::Layer LayerSurface::layer() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->layer; } -void WlrLayerSurface::setLayer(WlrLayerSurface::Layer layer) +void LayerSurface::setLayer(LayerSurface::Layer layer) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->layer == layer) return; if (d->initialized && !d->setLayerEnabled) { - qCWarning(lcQtShellIntegration, "Unable to change WlrLayerSurface::layer after initialization"); + qCWarning(lcQtShellIntegration, "Unable to change LayerSurface::layer after initialization"); return; } @@ -81,21 +81,21 @@ void WlrLayerSurface::setLayer(WlrLayerSurface::Layer layer) Q_EMIT layerChanged(d->layer); } -QString WlrLayerSurface::role() const +QString LayerSurface::role() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->role; } -void WlrLayerSurface::setRole(const QString &role) +void LayerSurface::setRole(const QString &role) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->role == role) return; if (d->initialized) { - qCWarning(lcQtShellIntegration, "Unable to change WlrLayerSurface::role after initialization"); + qCWarning(lcQtShellIntegration, "Unable to change LayerSurface::role after initialization"); return; } @@ -103,15 +103,15 @@ void WlrLayerSurface::setRole(const QString &role) Q_EMIT roleChanged(d->role); } -WlrLayerSurface::Anchors WlrLayerSurface::anchors() const +LayerSurface::Anchors LayerSurface::anchors() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->anchors; } -void WlrLayerSurface::setAnchors(WlrLayerSurface::Anchors anchors) +void LayerSurface::setAnchors(LayerSurface::Anchors anchors) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->anchors == anchors) return; @@ -120,15 +120,15 @@ void WlrLayerSurface::setAnchors(WlrLayerSurface::Anchors anchors) Q_EMIT anchorsChanged(d->anchors); } -qint32 WlrLayerSurface::exclusiveZone() const +qint32 LayerSurface::exclusiveZone() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->exclusiveZone; } -void WlrLayerSurface::setExclusiveZone(qint32 zone) +void LayerSurface::setExclusiveZone(qint32 zone) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->exclusiveZone == zone) return; @@ -137,21 +137,21 @@ void WlrLayerSurface::setExclusiveZone(qint32 zone) Q_EMIT exclusiveZoneChanged(d->exclusiveZone); } -QMargins WlrLayerSurface::margins() const +QMargins LayerSurface::margins() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->margins; } -qint32 WlrLayerSurface::leftMargin() const +qint32 LayerSurface::leftMargin() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->margins.left(); } -void WlrLayerSurface::setLeftMargin(qint32 margin) +void LayerSurface::setLeftMargin(qint32 margin) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->margins.left() == margin) return; @@ -161,15 +161,15 @@ void WlrLayerSurface::setLeftMargin(qint32 margin) Q_EMIT marginsChanged(d->margins); } -qint32 WlrLayerSurface::rightMargin() const +qint32 LayerSurface::rightMargin() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->margins.right(); } -void WlrLayerSurface::setRightMargin(qint32 margin) +void LayerSurface::setRightMargin(qint32 margin) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->margins.right() == margin) return; @@ -179,15 +179,15 @@ void WlrLayerSurface::setRightMargin(qint32 margin) Q_EMIT marginsChanged(d->margins); } -qint32 WlrLayerSurface::topMargin() const +qint32 LayerSurface::topMargin() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->margins.top(); } -void WlrLayerSurface::setTopMargin(qint32 margin) +void LayerSurface::setTopMargin(qint32 margin) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->margins.top() == margin) return; @@ -197,15 +197,15 @@ void WlrLayerSurface::setTopMargin(qint32 margin) Q_EMIT marginsChanged(d->margins); } -qint32 WlrLayerSurface::bottomMargin() const +qint32 LayerSurface::bottomMargin() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->margins.bottom(); } -void WlrLayerSurface::setBottomMargin(qint32 margin) +void LayerSurface::setBottomMargin(qint32 margin) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->margins.bottom() == margin) return; @@ -215,15 +215,15 @@ void WlrLayerSurface::setBottomMargin(qint32 margin) Q_EMIT marginsChanged(d->margins); } -WlrLayerSurface::KeyboardInteractivity WlrLayerSurface::keyboardInteractivity() const +LayerSurface::KeyboardInteractivity LayerSurface::keyboardInteractivity() const { - Q_D(const WlrLayerSurface); + Q_D(const LayerSurface); return d->keyboardInteractivity; } -void WlrLayerSurface::setKeyboardInteractivity(WlrLayerSurface::KeyboardInteractivity keyboardInteractivity) +void LayerSurface::setKeyboardInteractivity(LayerSurface::KeyboardInteractivity keyboardInteractivity) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->keyboardInteractivity == keyboardInteractivity) return; @@ -232,33 +232,33 @@ void WlrLayerSurface::setKeyboardInteractivity(WlrLayerSurface::KeyboardInteract Q_EMIT keyboardInteractivityChanged(d->keyboardInteractivity); } -void WlrLayerSurface::initialize() +void LayerSurface::initialize() { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); if (d->initialized) return; if (!d->window) { - qCWarning(lcQtShellIntegration, "Window not assigned to WlrLayerSurface, failed to initialize"); + qCWarning(lcQtShellIntegration, "Window not assigned to LayerSurface, failed to initialize"); return; } d->initialized = true; } -void WlrLayerSurface::setLayerEnabled(bool enabled) +void LayerSurface::setLayerEnabled(bool enabled) { - Q_D(WlrLayerSurface); + Q_D(LayerSurface); d->setLayerEnabled = enabled; } -WlrLayerSurface *WlrLayerSurface::get(QWindow *window) +LayerSurface *LayerSurface::get(QWindow *window) { return globalLayerSurfaces->value(window, nullptr); } -WlrLayerSurface *WlrLayerSurface::qmlAttachedProperties(QObject *object) +LayerSurface *LayerSurface::qmlAttachedProperties(QObject *object) { return get(qobject_cast(object)); } diff --git a/src/interfaces/wlrlayersurface.h b/src/interfaces/layersurface.h similarity index 65% rename from src/interfaces/wlrlayersurface.h rename to src/interfaces/layersurface.h index 64a3e6f..2877ffd 100644 --- a/src/interfaces/wlrlayersurface.h +++ b/src/interfaces/layersurface.h @@ -12,24 +12,24 @@ namespace Liri { namespace QtShellIntegration { -class WlrLayerSurfacePrivate; +class LayerSurfacePrivate; -class LIRIQTSHELLINTEGRATION_EXPORT WlrLayerSurface : public QObject +class LIRIQTSHELLINTEGRATION_EXPORT LayerSurface : public QObject { Q_OBJECT QML_ELEMENT - Q_DECLARE_PRIVATE(WlrLayerSurface) + Q_DECLARE_PRIVATE(LayerSurface) Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged) - Q_PROPERTY(Liri::QtShellIntegration::WlrLayerSurface::Layer layer READ layer WRITE setLayer NOTIFY layerChanged) + Q_PROPERTY(Liri::QtShellIntegration::LayerSurface::Layer layer READ layer WRITE setLayer NOTIFY layerChanged) Q_PROPERTY(QString role READ role WRITE setRole NOTIFY roleChanged) - Q_PROPERTY(Liri::QtShellIntegration::WlrLayerSurface::Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged) + Q_PROPERTY(Liri::QtShellIntegration::LayerSurface::Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged) Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged) Q_PROPERTY(QMargins margins READ margins NOTIFY marginsChanged) Q_PROPERTY(qint32 leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) Q_PROPERTY(qint32 rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) Q_PROPERTY(qint32 topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) Q_PROPERTY(qint32 bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) - Q_PROPERTY(Liri::QtShellIntegration::WlrLayerSurface::KeyboardInteractivity keyboardInteractivity READ keyboardInteractivity WRITE setKeyboardInteractivity NOTIFY keyboardInteractivityChanged) + Q_PROPERTY(Liri::QtShellIntegration::LayerSurface::KeyboardInteractivity keyboardInteractivity READ keyboardInteractivity WRITE setKeyboardInteractivity NOTIFY keyboardInteractivityChanged) public: enum Layer { BackgroundLayer = 0, @@ -56,21 +56,21 @@ class LIRIQTSHELLINTEGRATION_EXPORT WlrLayerSurface : public QObject }; Q_ENUM(KeyboardInteractivity) - ~WlrLayerSurface(); + ~LayerSurface(); bool isInitialized() const; QWindow *window() const; void setWindow(QWindow *window); - WlrLayerSurface::Layer layer() const; - void setLayer(WlrLayerSurface::Layer layer); + LayerSurface::Layer layer() const; + void setLayer(LayerSurface::Layer layer); QString role() const; void setRole(const QString &role); - WlrLayerSurface::Anchors anchors() const; - void setAnchors(WlrLayerSurface::Anchors anchors); + LayerSurface::Anchors anchors() const; + void setAnchors(LayerSurface::Anchors anchors); qint32 exclusiveZone() const; void setExclusiveZone(qint32 zone); @@ -89,39 +89,39 @@ class LIRIQTSHELLINTEGRATION_EXPORT WlrLayerSurface : public QObject qint32 bottomMargin() const; void setBottomMargin(qint32 margin); - WlrLayerSurface::KeyboardInteractivity keyboardInteractivity() const; - void setKeyboardInteractivity(WlrLayerSurface::KeyboardInteractivity keyboardInteractivity); + LayerSurface::KeyboardInteractivity keyboardInteractivity() const; + void setKeyboardInteractivity(LayerSurface::KeyboardInteractivity keyboardInteractivity); void initialize(); void setLayerEnabled(bool enabled); - static WlrLayerSurface *get(QWindow *window); + static LayerSurface *get(QWindow *window); - static WlrLayerSurface *qmlAttachedProperties(QObject *object); + static LayerSurface *qmlAttachedProperties(QObject *object); Q_SIGNALS: void windowChanged(QWindow *window); - void layerChanged(WlrLayerSurface::Layer layer); + void layerChanged(LayerSurface::Layer layer); void roleChanged(const QString &role); - void anchorsChanged(WlrLayerSurface::Anchors anchors); + void anchorsChanged(LayerSurface::Anchors anchors); void exclusiveZoneChanged(qint32 exclusiveZone); void marginsChanged(const QMargins &margins); void leftMarginChanged(qint32 margin); void rightMarginChanged(qint32 margin); void topMarginChanged(qint32 margin); void bottomMarginChanged(qint32 margin); - void keyboardInteractivityChanged(Liri::QtShellIntegration::WlrLayerSurface::KeyboardInteractivity keyboardInteractivity); + void keyboardInteractivityChanged(Liri::QtShellIntegration::LayerSurface::KeyboardInteractivity keyboardInteractivity); protected: - explicit WlrLayerSurface(QObject *parent = nullptr); + explicit LayerSurface(QObject *parent = nullptr); private: - QScopedPointer const d_ptr; + QScopedPointer const d_ptr; }; } // QtShellIntegration } // Liri -Q_DECLARE_OPERATORS_FOR_FLAGS(Liri::QtShellIntegration::WlrLayerSurface::Anchors) \ No newline at end of file +Q_DECLARE_OPERATORS_FOR_FLAGS(Liri::QtShellIntegration::LayerSurface::Anchors) \ No newline at end of file diff --git a/src/interfaces/wlrlayersurface_p.h b/src/interfaces/layersurface_p.h similarity index 67% rename from src/interfaces/wlrlayersurface_p.h rename to src/interfaces/layersurface_p.h index ab66981..7258a44 100644 --- a/src/interfaces/wlrlayersurface_p.h +++ b/src/interfaces/layersurface_p.h @@ -3,7 +3,7 @@ #pragma once -#include +#include // // W A R N I N G @@ -20,20 +20,20 @@ namespace Liri { namespace QtShellIntegration { -class WlrLayerSurfacePrivate +class LayerSurfacePrivate { public: - WlrLayerSurfacePrivate() = default; + LayerSurfacePrivate() = default; bool initialized = false; bool setLayerEnabled = false; QWindow *window = nullptr; - WlrLayerSurface::Layer layer = WlrLayerSurface::TopLayer; + LayerSurface::Layer layer = LayerSurface::TopLayer; QString role = QStringLiteral("unknown"); - WlrLayerSurface::Anchors anchors; + LayerSurface::Anchors anchors; qint32 exclusiveZone = 0; QMargins margins; - WlrLayerSurface::KeyboardInteractivity keyboardInteractivity = WlrLayerSurface::ExclusiveKeyboardInteractivity; + LayerSurface::KeyboardInteractivity keyboardInteractivity = LayerSurface::ExclusiveKeyboardInteractivity; }; } // namespace QtShellIntegration diff --git a/src/interfaces/extsessionlocksurface.cpp b/src/interfaces/sessionlocksurface.cpp similarity index 51% rename from src/interfaces/extsessionlocksurface.cpp rename to src/interfaces/sessionlocksurface.cpp index 172eadb..8855ff5 100644 --- a/src/interfaces/extsessionlocksurface.cpp +++ b/src/interfaces/sessionlocksurface.cpp @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: 2022-2024 Pier Luigi Fiorini // SPDX-License-Identifier: GPL-3.0-or-later -#include "extsessionlocksurface.h" -#include "extsessionlocksurface_p.h" +#include "sessionlocksurface.h" +#include "sessionlocksurface_p.h" #include "qtshellintegrationlogging.h" namespace Liri { @@ -11,57 +11,57 @@ namespace QtShellIntegration { // Both shell integration and QML plugins will share this global // since the interface is in a dynamic library -typedef QHash ExtSessionLockSurfaceMap; -Q_GLOBAL_STATIC(ExtSessionLockSurfaceMap, globalLockSurfaces) +typedef QHash SessionLockSurfaceMap; +Q_GLOBAL_STATIC(SessionLockSurfaceMap, globalLockSurfaces) -ExtSessionLockSurface::ExtSessionLockSurface(QObject *parent) +SessionLockSurface::SessionLockSurface(QObject *parent) : QObject(parent) - , d_ptr(new ExtSessionLockSurfacePrivate()) + , d_ptr(new SessionLockSurfacePrivate()) { } -ExtSessionLockSurface::~ExtSessionLockSurface() +SessionLockSurface::~SessionLockSurface() { - Q_D(ExtSessionLockSurface); + Q_D(SessionLockSurface); globalLockSurfaces->remove(d->window); } -bool ExtSessionLockSurface::isInitialized() const +bool SessionLockSurface::isInitialized() const { - Q_D(const ExtSessionLockSurface); + Q_D(const SessionLockSurface); return d->initialized; } -void ExtSessionLockSurface::initialize() +void SessionLockSurface::initialize() { - Q_D(ExtSessionLockSurface); + Q_D(SessionLockSurface); if (d->initialized) return; if (!d->window) { - qCWarning(lcQtShellIntegration, "Window not assigned to ExtSessionLockSurface, failed to initialize"); + qCWarning(lcQtShellIntegration, "Window not assigned to SessionLockSurface, failed to initialize"); return; } d->initialized = true; } -QWindow *ExtSessionLockSurface::window() const +QWindow *SessionLockSurface::window() const { - Q_D(const ExtSessionLockSurface); + Q_D(const SessionLockSurface); return d->window; } -void ExtSessionLockSurface::setWindow(QWindow *window) +void SessionLockSurface::setWindow(QWindow *window) { - Q_D(ExtSessionLockSurface); + Q_D(SessionLockSurface); if (d->window == window) return; if (d->initialized) { - qCWarning(lcQtShellIntegration, "Unable to change ExtSessionLockSurface::window after initialization"); + qCWarning(lcQtShellIntegration, "Unable to change SessionLockSurface::window after initialization"); return; } @@ -72,7 +72,7 @@ void ExtSessionLockSurface::setWindow(QWindow *window) globalLockSurfaces->insert(d->window, this); } -ExtSessionLockSurface *ExtSessionLockSurface::get(QWindow *window) +SessionLockSurface *SessionLockSurface::get(QWindow *window) { return globalLockSurfaces->value(window, nullptr); } diff --git a/src/interfaces/extsessionlocksurface.h b/src/interfaces/sessionlocksurface.h similarity index 65% rename from src/interfaces/extsessionlocksurface.h rename to src/interfaces/sessionlocksurface.h index 2e80004..73f4ad0 100644 --- a/src/interfaces/extsessionlocksurface.h +++ b/src/interfaces/sessionlocksurface.h @@ -13,17 +13,17 @@ namespace Liri { namespace QtShellIntegration { -class ExtSessionLockSurfacePrivate; +class SessionLockSurfacePrivate; -class LIRIQTSHELLINTEGRATION_EXPORT ExtSessionLockSurface : public QObject +class LIRIQTSHELLINTEGRATION_EXPORT SessionLockSurface : public QObject { Q_OBJECT QML_ELEMENT - Q_DECLARE_PRIVATE(ExtSessionLockSurface) + Q_DECLARE_PRIVATE(SessionLockSurface) Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged) public: - ExtSessionLockSurface(QObject *parent = nullptr); - ~ExtSessionLockSurface(); + SessionLockSurface(QObject *parent = nullptr); + ~SessionLockSurface(); bool isInitialized() const; @@ -32,14 +32,14 @@ class LIRIQTSHELLINTEGRATION_EXPORT ExtSessionLockSurface : public QObject QWindow *window() const; void setWindow(QWindow *window); - static ExtSessionLockSurface *get(QWindow *window); + static SessionLockSurface *get(QWindow *window); Q_SIGNALS: void windowChanged(QWindow *window); void unlockRequested(); private: - QScopedPointer const d_ptr; + QScopedPointer const d_ptr; }; } // QtShellIntegration diff --git a/src/interfaces/extsessionlocksurface_p.h b/src/interfaces/sessionlocksurface_p.h similarity index 80% rename from src/interfaces/extsessionlocksurface_p.h rename to src/interfaces/sessionlocksurface_p.h index 0faa9ce..2410764 100644 --- a/src/interfaces/extsessionlocksurface_p.h +++ b/src/interfaces/sessionlocksurface_p.h @@ -3,7 +3,7 @@ #pragma once -#include +#include namespace Liri { @@ -20,10 +20,10 @@ namespace QtShellIntegration { // We mean it. // -class ExtSessionLockSurfacePrivate +class SessionLockSurfacePrivate { public: - ExtSessionLockSurfacePrivate() = default; + SessionLockSurfacePrivate() = default; bool initialized = false; QWindow *window = nullptr; diff --git a/src/shell-integrations/ext-session-lock/qwaylandextsessionlock.cpp b/src/shell-integrations/ext-session-lock/qwaylandextsessionlock.cpp index 727aa25..9be2f28 100644 --- a/src/shell-integrations/ext-session-lock/qwaylandextsessionlock.cpp +++ b/src/shell-integrations/ext-session-lock/qwaylandextsessionlock.cpp @@ -21,7 +21,7 @@ QWaylandExtSessionLockSurface::QWaylandExtSessionLockSurface(QWaylandExtSessionL , QtWayland::ext_session_lock_surface_v1() , m_lock(lock) { - auto *interface = Liri::QtShellIntegration::ExtSessionLockSurface::get(window->window()); + auto *interface = Liri::QtShellIntegration::SessionLockSurface::get(window->window()); if (!interface) { qCWarning(lcQpaWayland) << "Cannot find LockSurface interface on window" << window->window(); return; @@ -29,7 +29,7 @@ QWaylandExtSessionLockSurface::QWaylandExtSessionLockSurface(QWaylandExtSessionL init(lock->get_lock_surface(window->wlSurface(), window->waylandScreen()->output())); - connect(interface, &Liri::QtShellIntegration::ExtSessionLockSurface::unlockRequested, + connect(interface, &Liri::QtShellIntegration::SessionLockSurface::unlockRequested, this, &QWaylandExtSessionLockSurface::handleUnlock); } diff --git a/src/shell-integrations/layer-shell/qwaylandlayersurface.cpp b/src/shell-integrations/layer-shell/qwaylandlayersurface.cpp index 99b9eac..98844d2 100644 --- a/src/shell-integrations/layer-shell/qwaylandlayersurface.cpp +++ b/src/shell-integrations/layer-shell/qwaylandlayersurface.cpp @@ -16,7 +16,7 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, { // Let's find the interface object associated with this window, // or bail out if we cannot find it - auto *interface = Liri::QtShellIntegration::WlrLayerSurface::get(window->window()); + auto *interface = Liri::QtShellIntegration::LayerSurface::get(window->window()); if (!interface) { qCWarning(lcQpaWayland) << "Cannot find LayerSurface interface on window" << window->window(); return; @@ -40,15 +40,15 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, setKeyboardInteractivity(interface->keyboardInteractivity()); // React to changes to the interface object - connect(interface, &Liri::QtShellIntegration::WlrLayerSurface::layerChanged, + connect(interface, &Liri::QtShellIntegration::LayerSurface::layerChanged, this, &QWaylandLayerSurface::setLayer); - connect(interface, &Liri::QtShellIntegration::WlrLayerSurface::anchorsChanged, + connect(interface, &Liri::QtShellIntegration::LayerSurface::anchorsChanged, this, &QWaylandLayerSurface::setAnchors); - connect(interface, &Liri::QtShellIntegration::WlrLayerSurface::exclusiveZoneChanged, + connect(interface, &Liri::QtShellIntegration::LayerSurface::exclusiveZoneChanged, this, &QWaylandLayerSurface::setExclusiveZone); - connect(interface, &Liri::QtShellIntegration::WlrLayerSurface::marginsChanged, + connect(interface, &Liri::QtShellIntegration::LayerSurface::marginsChanged, this, &QWaylandLayerSurface::setMargins); - connect(interface, &Liri::QtShellIntegration::WlrLayerSurface::keyboardInteractivityChanged, + connect(interface, &Liri::QtShellIntegration::LayerSurface::keyboardInteractivityChanged, this, &QWaylandLayerSurface::setKeyboardInteractivity); } @@ -82,7 +82,7 @@ void QWaylandLayerSurface::attachPopup(QWaylandShellSurface *popup) qCWarning(lcQpaWayland, "Cannot attach popup of unknown state"); } -void QWaylandLayerSurface::setLayer(Liri::QtShellIntegration::WlrLayerSurface::Layer layer) +void QWaylandLayerSurface::setLayer(Liri::QtShellIntegration::LayerSurface::Layer layer) { // This slot shouldn't even be called if the compositor supports an older version // because in this case the interface won't allow changing the layer after initialization, @@ -95,7 +95,7 @@ void QWaylandLayerSurface::setLayer(Liri::QtShellIntegration::WlrLayerSurface::L ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION, version); } -void QWaylandLayerSurface::setAnchors(Liri::QtShellIntegration::WlrLayerSurface::Anchors anchors) +void QWaylandLayerSurface::setAnchors(Liri::QtShellIntegration::LayerSurface::Anchors anchors) { m_anchors = anchors; set_anchor(static_cast(anchors)); @@ -108,12 +108,12 @@ void QWaylandLayerSurface::setSize(const QSize &surfaceSize) QSize size = surfaceSize; // Let the compositor set the width based on the output available width - if (m_anchors.testFlag(Liri::QtShellIntegration::WlrLayerSurface::LeftAnchor) && - m_anchors.testFlag(Liri::QtShellIntegration::WlrLayerSurface::RightAnchor)) + if (m_anchors.testFlag(Liri::QtShellIntegration::LayerSurface::LeftAnchor) && + m_anchors.testFlag(Liri::QtShellIntegration::LayerSurface::RightAnchor)) size.setWidth(0); // Let the compositor set the width based on the output available width - if (m_anchors.testFlag(Liri::QtShellIntegration::WlrLayerSurface::TopAnchor) && - m_anchors.testFlag(Liri::QtShellIntegration::WlrLayerSurface::BottomAnchor)) + if (m_anchors.testFlag(Liri::QtShellIntegration::LayerSurface::TopAnchor) && + m_anchors.testFlag(Liri::QtShellIntegration::LayerSurface::BottomAnchor)) size.setHeight(0); // Set size only if it's valid @@ -147,10 +147,10 @@ void QWaylandLayerSurface::setMargins(const QMargins &margins) window()->commit(); } -void QWaylandLayerSurface::setKeyboardInteractivity(Liri::QtShellIntegration::WlrLayerSurface::KeyboardInteractivity keyboardInteractivity) +void QWaylandLayerSurface::setKeyboardInteractivity(Liri::QtShellIntegration::LayerSurface::KeyboardInteractivity keyboardInteractivity) { auto version = zwlr_layer_surface_v1_get_version(object()); - if (keyboardInteractivity == Liri::QtShellIntegration::WlrLayerSurface::OnDemandKeyboardInteractivity && + if (keyboardInteractivity == Liri::QtShellIntegration::LayerSurface::OnDemandKeyboardInteractivity && version < ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION) { qCWarning(lcQpaWayland, "Ignoring on_demand keyboard interactivity: need at least version %d instead of %d", ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION, version); diff --git a/src/shell-integrations/layer-shell/qwaylandlayersurface_p.h b/src/shell-integrations/layer-shell/qwaylandlayersurface_p.h index 19d9540..458fe61 100644 --- a/src/shell-integrations/layer-shell/qwaylandlayersurface_p.h +++ b/src/shell-integrations/layer-shell/qwaylandlayersurface_p.h @@ -31,12 +31,12 @@ class Q_WAYLANDCLIENT_EXPORT QWaylandLayerSurface void attachPopup(QWaylandShellSurface *popup) override; public Q_SLOTS: - void setLayer(Liri::QtShellIntegration::WlrLayerSurface::Layer layer); - void setAnchors(Liri::QtShellIntegration::WlrLayerSurface::Anchors anchors); + void setLayer(Liri::QtShellIntegration::LayerSurface::Layer layer); + void setAnchors(Liri::QtShellIntegration::LayerSurface::Anchors anchors); void setSize(const QSize &surfaceSize); void setExclusiveZone(qint32 exclusiveZone); void setMargins(const QMargins &margins); - void setKeyboardInteractivity(Liri::QtShellIntegration::WlrLayerSurface::KeyboardInteractivity keyboardInteractivity); + void setKeyboardInteractivity(Liri::QtShellIntegration::LayerSurface::KeyboardInteractivity keyboardInteractivity); protected: void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override; @@ -44,7 +44,7 @@ public Q_SLOTS: private: QWaylandLayerShellIntegration *m_shell = nullptr; - Liri::QtShellIntegration::WlrLayerSurface::Anchors m_anchors; + Liri::QtShellIntegration::LayerSurface::Anchors m_anchors; bool m_configured = false; QSize m_pendingSize; };