summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandbufferref.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/qwaylandbufferref.cpp
parente88c2f37097901e228de70c62a0220386038a51a (diff)
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/qwaylandbufferref.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandbufferref.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp
index 7b5b3cd2b..2d073e5ee 100644
--- a/src/compositor/compositor_api/qwaylandbufferref.cpp
+++ b/src/compositor/compositor_api/qwaylandbufferref.cpp
@@ -110,7 +110,12 @@ bool QWaylandBufferRef::isNull() const
bool QWaylandBufferRef::hasBuffer() const
{
- return d->buffer && !d->buffer->isDestroyed();
+ return d->buffer;
+}
+
+bool QWaylandBufferRef::isDestroyed() const
+{
+ return d->buffer && d->buffer->isDestroyed();
}
struct ::wl_resource *QWaylandBufferRef::wl_buffer() const
@@ -128,10 +133,10 @@ QSize QWaylandBufferRef::size() const
QWaylandSurface::Origin QWaylandBufferRef::origin() const
{
- if (d->nullOrDestroyed())
- return QWaylandSurface::OriginBottomLeft;
+ if (d->buffer)
+ return d->buffer->origin();
- return d->buffer->origin();
+ return QWaylandSurface::OriginBottomLeft;
}
bool QWaylandBufferRef::isShm() const