summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2014-02-11 12:23:10 +0100
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-02-11 16:24:33 +0100
commit188b3fddb1f7e9d905ed146197e83c9e2c8b70aa (patch)
tree349f3a8296c14ef40833794947ce4f9de6c352b8
parent1ba6f8814f6be03a6d383a62caf3558cca93c8b9 (diff)
downloadqtwayland-188b3fddb1f7e9d905ed146197e83c9e2c8b70aa.tar.gz
qtwayland-188b3fddb1f7e9d905ed146197e83c9e2c8b70aa.tar.bz2
qtwayland-188b3fddb1f7e9d905ed146197e83c9e2c8b70aa.zip
fixup in serverbuffer compositor
Change-Id: Idb0ad89c47fdca7249022049c00063a4d0bac95a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--examples/server-buffer/compositor/main.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/server-buffer/compositor/main.cpp b/examples/server-buffer/compositor/main.cpp
index 04cdde40..24e9e7fb 100644
--- a/examples/server-buffer/compositor/main.cpp
+++ b/examples/server-buffer/compositor/main.cpp
@@ -111,14 +111,7 @@ public slots:
private slots:
void surfaceMapped() {
QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
-
- QWaylandSurfaceItem *item = surface->surfaceItem();
- if (!item) {
- item = new QWaylandSurfaceItem(surface, rootObject());
- item->setUseTextureAlpha(true);
- }
-
- item->setTouchEventsEnabled(true);
+ QQuickItem *item = surface->surfaceItem();
emit windowAdded(QVariant::fromValue(static_cast<QQuickItem *>(item)));
}
@@ -221,6 +214,10 @@ protected:
}
void surfaceCreated(QWaylandSurface *surface) {
+ QWaylandSurfaceItem *item = new QWaylandSurfaceItem(surface, rootObject());
+ item->setUseTextureAlpha(true);
+ item->setTouchEventsEnabled(true);
+
connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
connect(surface,SIGNAL(unmapped()), this,SLOT(surfaceUnmapped()));