From a62a8213895182b9e3c37d73248190448b46a2ba Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 29 Oct 2020 10:26:00 +0200 Subject: [PATCH] wayland: Port kwin to new DragAndDropIcon type The DragAndDropIcon type encapsulates the icon surface and its position. --- pointer_input.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pointer_input.cpp b/pointer_input.cpp index e18ff9e79a..f8f62f8422 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -968,8 +968,8 @@ void CursorImage::markAsRendered() if (m_currentSource == CursorSource::DragAndDrop) { // always sending a frame rendered to the drag icon surface to not freeze QtWayland (see https://bugreports.qt.io/browse/QTBUG-51599 ) if (auto ddi = waylandServer()->seat()->dragSource()) { - if (auto s = ddi->icon()) { - s->frameRendered(m_surfaceRenderedTimer.elapsed()); + if (const KWaylandServer::DragAndDropIcon *icon = ddi->icon()) { + icon->surface()->frameRendered(m_surfaceRenderedTimer.elapsed()); } } auto p = waylandServer()->seat()->dragPointer(); @@ -1152,11 +1152,11 @@ void CursorImage::updateDragCursor() const bool needsEmit = m_currentSource == CursorSource::DragAndDrop; QImage additionalIcon; if (auto ddi = waylandServer()->seat()->dragSource()) { - if (auto dragIcon = ddi->icon()) { - if (auto buffer = dragIcon->buffer()) { + if (const KWaylandServer::DragAndDropIcon *dragIcon = ddi->icon()) { + if (KWaylandServer::BufferInterface *buffer = dragIcon->surface()->buffer()) { additionalIcon = buffer->data().copy(); - additionalIcon.setDevicePixelRatio(dragIcon->bufferScale()); - additionalIcon.setOffset(dragIcon->offset()); + additionalIcon.setDevicePixelRatio(dragIcon->surface()->bufferScale()); + additionalIcon.setOffset(dragIcon->position()); } } }