diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-07-01 13:29:52 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-08-15 10:43:53 +0000 |
commit | b9f0673a7928c896f44caf282c61b1080651f6b8 (patch) | |
tree | cff32cb46504cc303f519608a89fccc49ca386aa /src/compositor/extensions/qwaylandwlshell.cpp | |
parent | f964f85dde7b847a725371da80b4860735a0aa28 (diff) |
Compositor: Add windowType property to QWaylandWlShellSurface
Change-Id: I61ee336d3bc83e034faa3b0bb69b8bbeb3a139fb
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
Diffstat (limited to 'src/compositor/extensions/qwaylandwlshell.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandwlshell.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index a644e4f4d..6d11fd50e 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -104,6 +104,7 @@ QWaylandWlShellSurfacePrivate::QWaylandWlShellSurfacePrivate() , m_shell(Q_NULLPTR) , m_surface(Q_NULLPTR) , m_focusPolicy(QWaylandWlShellSurface::DefaultFocus) + , m_windowType(Qt::WindowType::Window) { } @@ -117,6 +118,16 @@ void QWaylandWlShellSurfacePrivate::ping(uint32_t serial) send_ping(serial); } +void QWaylandWlShellSurfacePrivate::setWindowType(Qt::WindowType windowType) +{ + if (m_windowType == windowType) + return; + m_windowType = windowType; + + Q_Q(QWaylandWlShellSurface); + emit q->windowTypeChanged(); +} + void QWaylandWlShellSurfacePrivate::shell_surface_destroy_resource(Resource *) { Q_Q(QWaylandWlShellSurface); @@ -154,6 +165,7 @@ void QWaylandWlShellSurfacePrivate::shell_surface_set_toplevel(Resource *resourc Q_UNUSED(resource); Q_Q(QWaylandWlShellSurface); setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); + setWindowType(Qt::WindowType::Window); emit q->setDefaultToplevel(); } @@ -171,6 +183,7 @@ void QWaylandWlShellSurfacePrivate::shell_surface_set_transient(Resource *resour flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE ? QWaylandWlShellSurface::NoKeyboardFocus : QWaylandWlShellSurface::DefaultFocus; setFocusPolicy(focusPolicy); + setWindowType(Qt::WindowType::SubWindow); emit q->setTransient(parent_surface, QPoint(x,y), focusPolicy); } @@ -187,6 +200,7 @@ void QWaylandWlShellSurfacePrivate::shell_surface_set_fullscreen(Resource *resou QWaylandOutput *output = output_resource ? QWaylandOutput::fromResource(output_resource) : Q_NULLPTR; + setWindowType(Qt::WindowType::Window); emit q->setFullScreen(QWaylandWlShellSurface::FullScreenMethod(method), framerate, output); } @@ -199,6 +213,7 @@ void QWaylandWlShellSurfacePrivate::shell_surface_set_popup(Resource *resource, setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); QWaylandSeat *input = QWaylandSeat::fromSeatResource(input_device); QWaylandSurface *parentSurface = QWaylandSurface::fromResource(parent); + setWindowType(Qt::WindowType::Popup); emit q->setPopup(input, parentSurface, QPoint(x,y)); } @@ -212,6 +227,7 @@ void QWaylandWlShellSurfacePrivate::shell_surface_set_maximized(Resource *resour QWaylandOutput *output = output_resource ? QWaylandOutput::fromResource(output_resource) : Q_NULLPTR; + setWindowType(Qt::WindowType::Window); emit q->setMaximized(output); } @@ -594,6 +610,23 @@ QWaylandWlShellSurface::FocusPolicy QWaylandWlShellSurface::focusPolicy() const } /*! + * \qmlproperty enum QtWaylandCompositor::WlShellSurface::windowType + * + * This property holds the window type of the WlShellSurface. + */ + +/*! + * \property QWaylandWlShellSurface::windowType + * + * This property holds the window type of the QWaylandWlShellSurface. + */ +Qt::WindowType QWaylandWlShellSurface::windowType() const +{ + Q_D(const QWaylandWlShellSurface); + return d->m_windowType; +} + +/*! * \qmlproperty string QtWaylandCompositor::WlShellSurface::title * * This property holds the title of the WlShellSurface. |