summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandview.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-10-06 15:01:35 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2016-10-07 12:01:42 +0000
commit4a792b169ed3810d60ddb5f8fab576368fbd7c4f (patch)
treec76bc5c1a4d2f119d7f24c1944849d9f699aff61 /src/compositor/compositor_api/qwaylandview.cpp
parent985bd824ef70ea23484f70718b0f944533c4d076 (diff)
Rename QWaylandSurface::throttlingView to primaryView
And make sure QWaylandWlShellIntegration and QWaylandXdgShellV5Integration only send configure events if they have the primary view. Also add a convenience, QWaylandView::isPrimary. Change-Id: Ib3a9615f46c8c43897c7fac22f832d2581190c0a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandview.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandview.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandview.cpp b/src/compositor/compositor_api/qwaylandview.cpp
index f526c647f..2302fe604 100644
--- a/src/compositor/compositor_api/qwaylandview.cpp
+++ b/src/compositor/compositor_api/qwaylandview.cpp
@@ -232,7 +232,7 @@ bool QWaylandView::advance()
if (d->bufferLocked)
return false;
- if (d->surface && d->surface->throttlingView() == this) {
+ if (d->surface && d->surface->primaryView() == this) {
Q_FOREACH (QWaylandView *view, d->surface->views()) {
if (view != this && view->allowDiscardFrontBuffer() && view->d_func()->currentBuffer == d->currentBuffer)
view->discardCurrentBuffer();
@@ -346,6 +346,28 @@ void QWaylandView::setAllowDiscardFrontBuffer(bool discard)
}
/*!
+ * Makes this QWaylandView the primary view for the surface.
+ *
+ * \sa QWaylandSurface::primaryView
+ */
+void QWaylandView::setPrimary()
+{
+ Q_D(QWaylandView);
+ d->surface->setPrimaryView(this);
+}
+
+/*!
+ * Returns true if this QWaylandView is the primary view for the QWaylandSurface
+ *
+ * \sa QWaylandSurface::primaryView
+ */
+bool QWaylandView::isPrimary() const
+{
+ Q_D(const QWaylandView);
+ return d->surface->primaryView() == this;
+}
+
+/*!
* Returns the Wayland surface resource for this QWaylandView.
*/
struct wl_resource *QWaylandView::surfaceResource() const