Skip to content

Commit

Permalink
feat: support basic drag-and-drop operations
Browse files Browse the repository at this point in the history
  • Loading branch information
wineee authored and justforlxz committed Dec 12, 2023
1 parent f006a9d commit dbcc91a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/treeland/quick/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Item {

OutputDelegate {
property real topMargin: topbar.height
waylandCursor: cursor1
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/treeland/quick/qml/OutputDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ OutputItem {
id: rootOutputItem
required property WaylandOutput waylandOutput
property OutputViewport onscreenViewport: outputViewport
property Cursor waylandCursor

output: waylandOutput
devicePixelRatio: waylandOutput.scale
Expand All @@ -19,6 +20,7 @@ OutputItem {
visible: cursor.visible && !cursor.isHardwareCursor

Image {
id: cursorImage
source: cursor.imageSource
x: -cursor.hotspot.x
y: -cursor.hotspot.y
Expand All @@ -27,6 +29,14 @@ OutputItem {
height: cursor.size.height
sourceClipRect: cursor.sourceRect
}

SurfaceItem {
id: dragIcon
z: cursorImage.z - 1
flags: SurfaceItem.DontCacheLastBuffer
visible: waylandCursor.dragSurface !== null
surface: waylandCursor.dragSurface
}
}

OutputViewport {
Expand Down

0 comments on commit dbcc91a

Please sign in to comment.