diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-07-01 15:56:11 +0300 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2014-08-07 07:59:00 +0200 |
commit | d107e2ba88e44590f77c608073eee6429f3d3a8c (patch) | |
tree | 5b96804a31b04c8f17fff03907815f9a90fc24ab /src/client/qwaylandwlshellsurface.cpp | |
parent | 3419c5a868b6f528cfb17ee19261c937163ea7e0 (diff) |
Add a way to have out of source shell integrations
Some platforms (especially non-desktop ones) may use a custom
Wayland shell extension, more tailored to the form factor than
the generic and desktoppy wl_shell or xdg_shell. Instead of stuffing
N protocol implementations in the QPA plugin use a plugin architecture
to allow them to live out of tree.
When creating a shell surface the QT_WAYLAND_SHELL_INTEGRATION env
variable will be checked, and if it points to a valid plugin that
will be used to create the shell surface, falling back to wl_shell
or xdg_shell if no plugin is specified.
Change-Id: I05019174bb915199dd726f5fdcc0385ef846e8de
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Philippe Coval <rzr@gna.org>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/client/qwaylandwlshellsurface.cpp')
-rw-r--r-- | src/client/qwaylandwlshellsurface.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 4b73ec232..a8e89ec98 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -46,6 +46,7 @@ #include "qwaylandinputdevice_p.h" #include "qwaylanddecoration_p.h" #include "qwaylandscreen_p.h" +#include "qwaylandextendedsurface_p.h" #include <QtCore/QDebug> @@ -53,15 +54,20 @@ QT_BEGIN_NAMESPACE QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window) : QtWayland::wl_shell_surface(shell_surface) + , QWaylandShellSurface(window) , m_window(window) , m_maximized(false) , m_fullscreen(false) + , m_extendedWindow(Q_NULLPTR) { + if (window->display()->windowExtension()) + m_extendedWindow = new QWaylandExtendedSurface(window); } QWaylandWlShellSurface::~QWaylandWlShellSurface() { wl_shell_surface_destroy(object()); + delete m_extendedWindow; } void QWaylandWlShellSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) @@ -87,6 +93,36 @@ void QWaylandWlShellSurface::setAppId(const QString & appId) return QtWayland::wl_shell_surface::set_class(appId); } +void QWaylandWlShellSurface::raise() +{ + if (m_extendedWindow) + m_extendedWindow->raise(); +} + +void QWaylandWlShellSurface::lower() +{ + if (m_extendedWindow) + m_extendedWindow->lower(); +} + +void QWaylandWlShellSurface::setContentOrientationMask(Qt::ScreenOrientations orientation) +{ + if (m_extendedWindow) + m_extendedWindow->setContentOrientationMask(orientation); +} + +void QWaylandWlShellSurface::setWindowFlags(Qt::WindowFlags flags) +{ + if (m_extendedWindow) + m_extendedWindow->setWindowFlags(flags); +} + +void QWaylandWlShellSurface::sendProperty(const QString &name, const QVariant &value) +{ + if (m_extendedWindow) + m_extendedWindow->updateGenericProperty(name, value); +} + void QWaylandWlShellSurface::setMaximized() { m_maximized = true; |