diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index edb34e0bd..ea94433bb 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -52,7 +52,7 @@ #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> #include <QtWaylandCompositor/private/qwaylandview_p.h> -#include <QtWaylandCompositor/private/qwaylandinput_p.h> +#include <QtWaylandCompositor/private/qwaylandseat_p.h> #include <QtCore/private/qobject_p.h> @@ -129,7 +129,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() , bufferScale(1) , isCursorSurface(false) , destroyed(false) - , mapped(false) + , hasContent(false) , isInitialized(false) , contentOrientation(Qt::PrimaryOrientation) , inputMethodControl(Q_NULLPTR) @@ -193,9 +193,9 @@ void QWaylandSurfacePrivate::notifyViewsAboutDestruction() foreach (QWaylandView *view, views) { QWaylandViewPrivate::get(view)->markSurfaceAsDestroyed(q); } - if (mapped) { - mapped = false; - emit q->mappedChanged(); + if (hasContent) { + hasContent = false; + emit q->hasContentChanged(); } } @@ -342,10 +342,10 @@ void QWaylandSurfacePrivate::setBackBuffer(QtWayland::SurfaceBuffer *b, const QR emit q->damaged(damage); - bool oldMapped = mapped; - mapped = QtWayland::SurfaceBuffer::hasContent(buffer); - if (oldMapped != mapped) - emit q->mappedChanged(); + bool oldHasContent = hasContent; + hasContent = QtWayland::SurfaceBuffer::hasContent(buffer); + if (oldHasContent != hasContent) + emit q->hasContentChanged(); if (!pending.offset.isNull()) emit q->offsetForNextFrame(pending.offset); @@ -484,20 +484,20 @@ QWaylandClient *QWaylandSurface::client() const } /*! - * \qmlproperty bool QtWaylandCompositor::WaylandSurface::isMapped + * \qmlproperty bool QtWaylandCompositor::WaylandSurface::hasContent * * This property holds whether the WaylandSurface has content. */ /*! - * \property QWaylandSurface::isMapped + * \property QWaylandSurface::hasContent * * This property holds whether the QWaylandSurface has content. */ -bool QWaylandSurface::isMapped() const +bool QWaylandSurface::hasContent() const { Q_D(const QWaylandSurface); - return d->mapped; + return d->hasContent; } /*! @@ -708,9 +708,9 @@ QWaylandInputMethodControl *QWaylandSurface::inputMethodControl() const void QWaylandSurface::updateSelection() { Q_D(QWaylandSurface); - QWaylandInputDevice *inputDevice = d->compositor->defaultInputDevice(); - if (inputDevice) { - const QtWayland::DataDevice *dataDevice = QWaylandInputDevicePrivate::get(inputDevice)->dataDevice(); + QWaylandSeat *seat = d->compositor->defaultSeat(); + if (seat) { + const QtWayland::DataDevice *dataDevice = QWaylandSeatPrivate::get(seat)->dataDevice(); if (dataDevice) { QWaylandCompositorPrivate::get(d->compositor)->dataDeviceManager()->offerRetainedSelection( dataDevice->resourceMap().value(d->resource()->client())->handle); @@ -894,4 +894,16 @@ void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Re qDebug() << Q_FUNC_INFO; } +/*! + * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(object drag) + * + * This signal is emitted when a drag has started from this surface. + */ + +/*! + * \fn void QWaylandSurface::dragStarted(QWaylandDrag *drag) + * + * This signal is emitted when a drag has started from this surface. + */ + QT_END_NAMESPACE |