Skip to content

Commit 8c2768e

Browse files
committed
fix: prevent touchscreen right-click context menu
Modified notification view delegate to check for touchscreen device type before showing context menu on right-click. Added PointerDevice.TouchScreen type check to both TapHandler instances in the DelegateChooser. The previous implementation would trigger context menu on right-click gestures from touchscreen devices, which was unintended behavior. Touchscreen right-clicks are typically long-press gestures that should not open the same context menu as mouse right-clicks. This change ensures context menus only appear when using mouse input devices. Influence: 1. Test right-click with mouse on notification items - context menu should appear 2. Test long-press/touch gestures on touchscreen devices - context menu should not appear 3. Verify regular left-click functionality remains unchanged 4. Test touchscreen interactions with other gestures to ensure no regression PMS: BUG-355017
1 parent 79ee98f commit 8c2768e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

panels/notification/center/NotifyViewDelegate.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ DelegateChooser {
115115
TapHandler {
116116
acceptedButtons: Qt.RightButton
117117
onPressedChanged: function () {
118-
if (pressed) {
118+
if (pressed && point.device.type !== PointerDevice.TouchScreen) {
119119
let pos = point.position
120120
setting(pos)
121121
}
@@ -200,7 +200,7 @@ DelegateChooser {
200200
TapHandler {
201201
acceptedButtons: Qt.RightButton
202202
onPressedChanged: function () {
203-
if (pressed) {
203+
if (pressed && point.device.type !== PointerDevice.TouchScreen) {
204204
let pos = point.position
205205
setting(pos)
206206
}

0 commit comments

Comments
 (0)