Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ Window {

function onWidthChanged() {
if (dock.useColumnLayout) {
Panel.notifyDockPositionChanged()
Panel.notifyDockPositionChanged(dock.width, 0)
}
}

function onHeightChanged() {
if (!dock.useColumnLayout) {
Panel.notifyDockPositionChanged()
Panel.notifyDockPositionChanged(0, dock.height)
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ AppletItemButton {

Drag.dragType: Drag.Automatic
DQuickDrag.overlay: overlayWindow
DQuickDrag.active: Drag.active
DQuickDrag.active: Drag.active && Qt.platform.pluginName === "xcb"
DQuickDrag.hotSpotScale: Qt.size(0.5, 1)
Drag.mimeData: {
"text/x-dde-shell-tray-dnd-surfaceId": model.surfaceId,
Expand All @@ -172,6 +172,12 @@ AppletItemButton {
DDT.TraySortOrderModel.actionsAlwaysVisible = Drag.active
}

if (Qt.platform.pluginName !== "xcb") {
root.grabToImage(function(result) {
root.Drag.imageSource = result.url;
})
}

if (!Drag.active) {
Panel.contextDragging = false
// reset position on drop
Expand All @@ -181,6 +187,14 @@ AppletItemButton {
Panel.contextDragging = true
}

onWidthChanged: {
if (Qt.platform.pluginName !== "xcb") {
root.grabToImage(function(result) {
root.Drag.imageSource = result.url;
})
}
}
Comment on lines +190 to +196
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Re-evaluate triggering grabToImage on every width change for non-xcb platforms.

This handler will invoke grabToImage on every width change for non-xcb platforms, which can be expensive (e.g., during animations, layout changes, or DPI/scale updates) and may cause jank if multiple items update. Consider only doing this while a drag is active, or debounce/coalesce width changes to avoid repeated grabs during rapid size updates.

Suggested change
onWidthChanged: {
if (Qt.platform.pluginName !== "xcb") {
root.grabToImage(function(result) {
root.Drag.imageSource = result.url;
})
}
}
onWidthChanged: {
// Avoid expensive grabToImage calls on every width change:
// only update the drag image while a drag is actually active.
if (Qt.platform.pluginName !== "xcb" && Drag.active) {
root.grabToImage(function(result) {
root.Drag.imageSource = result.url;
})
}
}


DragHandler {
id: dragHandler
enabled: dragable
Expand Down