summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshellv5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgshellv5.cpp')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp
index 0a86b9f6f..80aa52e70 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp
@@ -225,7 +225,7 @@ QWaylandXdgSurfaceV5Private::QWaylandXdgSurfaceV5Private()
, m_xdgShell(nullptr)
, m_surface(nullptr)
, m_parentSurface(nullptr)
- , m_windowType(UnknownWindowType)
+ , m_windowType(Qt::WindowType::Window)
, m_unsetWindowGeometry(true)
, m_lastAckedConfigure({{}, QSize(0, 0), 0})
{
@@ -272,6 +272,17 @@ void QWaylandXdgSurfaceV5Private::updateFallbackWindowGeometry()
emit q->windowGeometryChanged();
}
+void QWaylandXdgSurfaceV5Private::setWindowType(Qt::WindowType windowType)
+{
+ if (m_windowType == windowType)
+ return;
+
+ m_windowType = windowType;
+
+ Q_Q(QWaylandXdgSurfaceV5);
+ emit q->windowTypeChanged();
+}
+
void QWaylandXdgSurfaceV5Private::xdg_surface_destroy_resource(Resource *resource)
{
Q_UNUSED(resource);
@@ -358,13 +369,13 @@ void QWaylandXdgSurfaceV5Private::xdg_surface_set_parent(Resource *resource, wl_
emit q->parentSurfaceChanged();
}
- if (m_parentSurface && m_windowType != TransientWindowType) {
+ if (m_parentSurface && m_windowType != Qt::WindowType::SubWindow) {
// There's a parent now, which means the surface is transient
- m_windowType = TransientWindowType;
+ setWindowType(Qt::WindowType::SubWindow);
emit q->setTransient();
- } else if (!m_parentSurface && m_windowType != TopLevelWindowType) {
+ } else if (!m_parentSurface && m_windowType != Qt::WindowType::Window) {
// When the surface has no parent it is toplevel
- m_windowType = TopLevelWindowType;
+ setWindowType(Qt::WindowType::Window);
emit q->setTopLevel();
}
}
@@ -758,6 +769,23 @@ QWaylandSurface *QWaylandXdgSurfaceV5::surface() const
}
/*!
+ * \qmlproperty enum QtWaylandCompositor::XdgSurfaceV5::windowType
+ *
+ * This property holds the window type of the XdgSurfaceV5.
+ */
+
+/*!
+ * \property QWaylandXdgSurfaceV5::windowType
+ *
+ * This property holds the window type of the QWaylandXdgSurfaceV5.
+ */
+Qt::WindowType QWaylandXdgSurfaceV5::windowType() const
+{
+ Q_D(const QWaylandXdgSurfaceV5);
+ return d->m_windowType;
+}
+
+/*!
* \qmlproperty object QtWaylandCompositor::XdgSurface::parentSurface
*
* This property holds the XdgSurface parent of this XdgSurface.