Skip to content

Commit 6e1bd64

Browse files
committed
fix: fall back to Qt default drag for wayland quick panel
In Wayland environment, the custom DQuickDrag overlay window causes issues with the quick panel drag functionality. This change forces DQuickDrag to be inactive on non-X11 platforms, falling back to Qt's native drag which uses the automatic image source. Additionally, the Drag properties (imageSource and hotSpot) are only set when not on XCB, as Qt's automatic drag handles these correctly on Wayland. Log: Disable custom drag overlay on Wayland for quick panel items Influence: 1. Test quick panel item drag on X11 session to ensure custom overlay still works 2. Test quick panel item drag on Wayland session to verify Qt default drag works 3. Check that the drag image and hotspot are positioned correctly on both platforms 4. Verify no visual glitches or crashes during drag operations fix: wayland下快捷面板拖拽回退到qt默认拖拽 在wayland环境下,自定义DQuickDrag覆盖窗口会导致快捷面板拖拽功能出现问 题。此修改强制在非X11平台上禁用DQuickDrag,回退到使用自动图片源的Qt原生 拖拽。同时,Drag属性(imageSource和hotSpot)仅在不使用XCB时设置,因为Qt 的自动拖拽在wayland上能正确处理这些属性。 Log: 在wayland上禁用快捷面板项目的自定义拖拽覆盖 Influence: 1. 在X11会话中测试快捷面板项目拖拽,确保自定义覆盖仍正常工作 2. 在wayland会话中测试快捷面板项目拖拽,验证Qt默认拖拽功能正常 3. 检查两个平台下拖拽图片和热点位置是否正确 4. 验证拖拽操作过程中无视觉异常或崩溃 PMS: BUG-346735
1 parent 5aff04e commit 6e1bd64

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

panels/dock/tray/quickpanel/DragItem.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ Item {
2828
})
2929
dragItem.Drag.dragType = Drag.Automatic
3030
dragItem.Drag.supportedActions = Qt.CopyAction
31+
if (Qt.platform.pluginName !== "xcb") {
32+
dragItem.Drag.imageSource = Qt.binding(function () {
33+
return root.draggingImage
34+
})
35+
dragItem.Drag.hotSpot.x = Qt.binding(function () {
36+
return dragItem.width / 2
37+
})
38+
dragItem.Drag.hotSpot.y = Qt.binding(function () {
39+
return dragItem.height / 2
40+
})
41+
}
3142
dragItem.DQuickDrag.hotSpotScale = Qt.binding(function () {
3243
return Qt.size(0.5, 0.5)
3344
})
3445
dragItem.DQuickDrag.active = Qt.binding(function () {
35-
return dragItem.Drag.active
46+
return dragItem.Drag.active && Qt.platform.pluginName === "xcb"
3647
})
3748
dragItem.DQuickDrag.overlay = Qt.binding(function () {
3849
return overlayWindow

0 commit comments

Comments
 (0)