Skip to content

Commit c5982f0

Browse files
Ivy233deepin-bot[bot]
authored andcommitted
fix: restore right-click context menu in windowed launcher's frequently used view
The TapHandler addition in 957e8a7 caused MouseArea to participate in the pointer event delivery system, which bypassed the acceptedButtons filter and allowed right-click events to be consumed by onClicked, triggering app launch instead of the context menu. fix: 修复弹窗启动器"常用应用"区域右键菜单失效的问题 957e8a7 提交中新增的 TapHandler 导致 MouseArea 参与指针事件分发系统, 绕过了 acceptedButtons 过滤,右键事件被 onClicked 消费,触发启动应用 而非弹出右键菜单。 PMS: BUG-360855
1 parent 44b8409 commit c5982f0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

qml/windowed/IconItemDelegate.qml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,27 @@ Control {
6666
}
6767

6868
onPressed: function (mouse) {
69+
if (mouse.button !== Qt.LeftButton) {
70+
mouse.accepted = false
71+
return
72+
}
6973
isTouchLongPressed = false
70-
if (mouse.button === Qt.LeftButton && root.dndEnabled) {
74+
if (root.dndEnabled) {
7175
appIcon.grabToImage(function(result) {
7276
root.Drag.imageSource = result.url;
7377
})
7478
}
7579
}
76-
onClicked: {
80+
onClicked: function(mouse) {
7781
if (isTouchLongPressed) {
7882
isTouchLongPressed = false
7983
return
8084
}
8185

86+
if (mouse.button !== Qt.LeftButton) {
87+
return
88+
}
89+
8290
if (!drag.active) {
8391
root.itemClicked()
8492
}

0 commit comments

Comments
 (0)