summaryrefslogtreecommitdiffstats
path: root/src/imports/compositor/WaylandCursorItem.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/compositor/WaylandCursorItem.qml')
-rw-r--r--src/imports/compositor/WaylandCursorItem.qml25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/imports/compositor/WaylandCursorItem.qml b/src/imports/compositor/WaylandCursorItem.qml
index 9eacff9be..931acbb08 100644
--- a/src/imports/compositor/WaylandCursorItem.qml
+++ b/src/imports/compositor/WaylandCursorItem.qml
@@ -39,17 +39,19 @@ import QtWayland.Compositor 1.0
WaylandQuickItem {
id: cursorItem
- property QtObject inputDevice
+ property QtObject seat
property int hotspotX: 0
property int hotspotY: 0
visible: cursorItem.surface != null
inputEventsEnabled: false
+ enabled: false
+ transform: Translate { x: -hotspotX; y: -hotspotY }
- onInputDeviceChanged: {
- if (!inputDevice)
+ onSeatChanged: {
+ if (!seat)
return;
- inputDevice.cursorSurfaceRequest.connect(setCursorSurface);
+ seat.cursorSurfaceRequest.connect(setCursorSurface);
}
function setCursorSurface(surface, hotspotX, hotspotY) {
@@ -57,4 +59,19 @@ WaylandQuickItem {
cursorItem.hotspotX = hotspotX;
cursorItem.hotspotY = hotspotY;
}
+
+ WaylandQuickItem {
+ id: dragIcon
+ property point offset
+
+ x: cursorItem.hotspotX + offset.x
+ y: cursorItem.hotspotY + offset.y
+ z: -1
+ surface: cursorItem.seat.drag.icon
+
+ Connections {
+ target: dragIcon.surface
+ onOffsetForNextFrame: dragIcon.offset = offset;
+ }
+ }
}