summaryrefslogtreecommitdiff
path: root/src/compositor/compositor_api/qwaylandquicksurface.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-07-30 12:05:12 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:09:41 +0200
commitab6980d57609b1e4bdb164d3413faa2f7cb7e1e4 (patch)
treeef68f66511347c0545559df6a81b6d56c6448eb4 /src/compositor/compositor_api/qwaylandquicksurface.cpp
parente88c2f37097901e228de70c62a0220386038a51a (diff)
downloadqtwayland-ab6980d57609b1e4bdb164d3413faa2f7cb7e1e4.tar.gz
Move the output from QWaylandSurface to the QWaylandSurfaceView
and add a property called primaryOutput on the QWaylandSurface. Also add some bookkeeping in QtWayland::Output so it knows what surfaces and views it currently holds, sending the enter and leave events automatically. Change-Id: Ib6efbc6f8157657fb4451b751bba1cb5345b7906
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquicksurface.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandquicksurface.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compositor/compositor_api/qwaylandquicksurface.cpp b/src/compositor/compositor_api/qwaylandquicksurface.cpp
index ebefb3bc..96e9ca48 100644
--- a/src/compositor/compositor_api/qwaylandquicksurface.cpp
+++ b/src/compositor/compositor_api/qwaylandquicksurface.cpp
@@ -70,8 +70,10 @@ public:
{
QWaylandSurfacePrivate::surface_commit(resource);
- Q_FOREACH (QtWayland::Output *output, outputs())
- output->waylandOutput()->update();
+ Q_FOREACH (QWaylandSurfaceView *view, views) {
+ if (view->output())
+ view->output()->update();
+ }
}
QWaylandQuickCompositor *compositor;
@@ -85,7 +87,7 @@ QWaylandQuickSurface::QWaylandQuickSurface(wl_client *client, quint32 id, int ve
{
Q_D(QWaylandQuickSurface);
connect(this, &QWaylandSurface::shellViewCreated, this, &QWaylandQuickSurface::shellViewCreated);
- connect(this, &QWaylandSurface::outputChanged, this, &QWaylandQuickSurface::outputWindowChanged);
+ connect(this, &QWaylandSurface::primaryOutputChanged, this, &QWaylandQuickSurface::primaryOutputWindowChanged);
connect(this, &QWaylandSurface::windowPropertyChanged, d->windowPropertyMap, &QQmlPropertyMap::insert);
connect(d->windowPropertyMap, &QQmlPropertyMap::valueChanged, this, &QWaylandSurface::setWindowProperty);
@@ -126,9 +128,9 @@ QWaylandSurfaceItem *QWaylandQuickSurface::shellView() const
return static_cast<QWaylandSurfaceItem *>(QWaylandSurface::shellView());
}
-QWindow *QWaylandQuickSurface::outputWindow() const
+QWindow *QWaylandQuickSurface::primaryOutputWindow() const
{
- return output() ? output()->window() : Q_NULLPTR;
+ return primaryOutput() ? primaryOutput()->window() : Q_NULLPTR;
}
bool QWaylandQuickSurface::event(QEvent *e)