Commit a62a8213 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Port kwin to new DragAndDropIcon type

The DragAndDropIcon type encapsulates the icon surface and its position.
parent 94389de8
...@@ -968,8 +968,8 @@ void CursorImage::markAsRendered() ...@@ -968,8 +968,8 @@ void CursorImage::markAsRendered()
if (m_currentSource == CursorSource::DragAndDrop) { 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 ) // 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 ddi = waylandServer()->seat()->dragSource()) {
if (auto s = ddi->icon()) { if (const KWaylandServer::DragAndDropIcon *icon = ddi->icon()) {
s->frameRendered(m_surfaceRenderedTimer.elapsed()); icon->surface()->frameRendered(m_surfaceRenderedTimer.elapsed());
} }
} }
auto p = waylandServer()->seat()->dragPointer(); auto p = waylandServer()->seat()->dragPointer();
...@@ -1152,11 +1152,11 @@ void CursorImage::updateDragCursor() ...@@ -1152,11 +1152,11 @@ void CursorImage::updateDragCursor()
const bool needsEmit = m_currentSource == CursorSource::DragAndDrop; const bool needsEmit = m_currentSource == CursorSource::DragAndDrop;
QImage additionalIcon; QImage additionalIcon;
if (auto ddi = waylandServer()->seat()->dragSource()) { if (auto ddi = waylandServer()->seat()->dragSource()) {
if (auto dragIcon = ddi->icon()) { if (const KWaylandServer::DragAndDropIcon *dragIcon = ddi->icon()) {
if (auto buffer = dragIcon->buffer()) { if (KWaylandServer::BufferInterface *buffer = dragIcon->surface()->buffer()) {
additionalIcon = buffer->data().copy(); additionalIcon = buffer->data().copy();
additionalIcon.setDevicePixelRatio(dragIcon->bufferScale()); additionalIcon.setDevicePixelRatio(dragIcon->surface()->bufferScale());
additionalIcon.setOffset(dragIcon->offset()); additionalIcon.setOffset(dragIcon->position());
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment