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/qwaylandxdgsurface.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/qwaylandxdgsurface.cpp')
-rw-r--r-- | src/client/qwaylandxdgsurface.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index 5fb74d25b..126c9db72 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.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,16 +54,21 @@ QT_BEGIN_NAMESPACE QWaylandXdgSurface::QWaylandXdgSurface(struct ::xdg_surface *xdg_surface, QWaylandWindow *window) : QtWayland::xdg_surface(xdg_surface) + , QWaylandShellSurface(window) , m_window(window) , m_maximized(false) , m_minimized(false) , m_fullscreen(false) + , m_extendedWindow(Q_NULLPTR) { + if (window->display()->windowExtension()) + m_extendedWindow = new QWaylandExtendedSurface(window); } QWaylandXdgSurface::~QWaylandXdgSurface() { xdg_surface_destroy(object()); + delete m_extendedWindow; } void QWaylandXdgSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) @@ -160,6 +166,36 @@ void QWaylandXdgSurface::setAppId(const QString & appId) return QtWayland::xdg_surface::set_app_id(appId); } +void QWaylandXdgSurface::raise() +{ + if (m_extendedWindow) + m_extendedWindow->raise(); +} + +void QWaylandXdgSurface::lower() +{ + if (m_extendedWindow) + m_extendedWindow->lower(); +} + +void QWaylandXdgSurface::setContentOrientationMask(Qt::ScreenOrientations orientation) +{ + if (m_extendedWindow) + m_extendedWindow->setContentOrientationMask(orientation); +} + +void QWaylandXdgSurface::setWindowFlags(Qt::WindowFlags flags) +{ + if (m_extendedWindow) + m_extendedWindow->setWindowFlags(flags); +} + +void QWaylandXdgSurface::sendProperty(const QString &name, const QVariant &value) +{ + if (m_extendedWindow) + m_extendedWindow->updateGenericProperty(name, value); +} + void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height) { m_window->configure(0 , width, height); |