Skip to content

Commit

Permalink
fix: fix magnifying glass on multi outputs
Browse files Browse the repository at this point in the history
sync from waylib 0574fff261b06bdf80fc18639b38a1343ba23ee1

Log:
  • Loading branch information
justforlxz committed Jan 9, 2024
1 parent 5953f34 commit bb5ddb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/treeland/quick/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Item {
id: backend

onOutputAdded: function(output) {
output.forceSoftwareCursor = true // Test
if (!backend.hasDrm)
output.forceSoftwareCursor = true // Test

TreeLandHelper.allowNonDrmOutputAutoChangeMode(output)
QmlHelper.outputManager.add({waylandOutput: output})
Expand Down
4 changes: 4 additions & 0 deletions src/treeland/quick/qml/OutputDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ OutputItem {
OutputViewport {
readonly property OutputItem outputItem: waylandOutput.OutputItem.item

id: viewport
root: true
output: waylandOutput
devicePixelRatio: outputViewport.devicePixelRatio

TextureProxy {
sourceItem: outputViewport
anchors.fill: parent
}

Item {
Expand Down Expand Up @@ -135,6 +137,8 @@ OutputItem {
smooth: false
scale: 10
transformOrigin: Item.TopLeft
width: viewport.width
height: viewport.height

function updatePosition() {
const pos = outputItem.lastActiveCursorItem.mapToItem(outputViewport, Qt.point(0, 0))
Expand Down

0 comments on commit bb5ddb4

Please sign in to comment.