summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandsurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 9391164cf..ed028824f 100644
--- a/src/compositor/compositor_api/qwaylandsurface.cpp
+++ b/src/compositor/compositor_api/qwaylandsurface.cpp
@@ -130,6 +130,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate()
, mapped(false)
, isInitialized(false)
, contentOrientation(Qt::PrimaryOrientation)
+ , subsurface(0)
{
pending.buffer = 0;
pending.newlyAttached = false;
@@ -777,4 +778,50 @@ void QWaylandSurfacePrivate::derefView(QWaylandView *view)
}
}
+void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version)
+{
+ Q_Q(QWaylandSurface);
+ QWaylandSurface *oldParent = 0; // TODO: implement support for switching parents
+
+ subsurface = new Subsurface(this);
+ subsurface->init(client, id, version);
+ subsurface->parentSurface = parent->d_func();
+ emit q->parentChanged(parent, oldParent);
+ emit parent->childAdded(q);
+}
+
+void QWaylandSurfacePrivate::Subsurface::subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y)
+{
+ Q_UNUSED(resource);
+ position = QPoint(x,y);
+ emit surface->q_func()->subsurfacePositionChanged(position);
+
+}
+
+void QWaylandSurfacePrivate::Subsurface::subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling)
+{
+ Q_UNUSED(resource);
+ emit surface->q_func()->subsurfacePlaceAbove(QWaylandSurface::fromResource(sibling));
+}
+
+void QWaylandSurfacePrivate::Subsurface::subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling)
+{
+ Q_UNUSED(resource);
+ emit surface->q_func()->subsurfacePlaceBelow(QWaylandSurface::fromResource(sibling));
+}
+
+void QWaylandSurfacePrivate::Subsurface::subsurface_set_sync(wl_subsurface::Resource *resource)
+{
+ Q_UNUSED(resource);
+ // TODO: sync/desync implementation
+ qDebug() << Q_FUNC_INFO;
+}
+
+void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Resource *resource)
+{
+ Q_UNUSED(resource);
+ // TODO: sync/desync implementation
+ qDebug() << Q_FUNC_INFO;
+}
+
QT_END_NAMESPACE