Commit 2da197f
committed
fix: separate touchscreen and mouse context menu triggers in notification center
Split the context menu TapHandler into two separate handlers with device
filtering to prevent touchscreen tap from incorrectly triggering the
context menu when expanding collapsed notifications:
1. Mouse/other devices handler: uses acceptedDevices with
PointerDevice.AllDevices & ~PointerDevice.TouchScreen to exclude
touchscreen, as touchscreen events bypass acceptedButtons check in Qt
2. Touchscreen handler: only accepts long-press gesture from TouchScreen
device
This ensures that a single-finger tap on a collapsed notification only
expands it without showing the context menu, while long-press still
triggers the menu as expected.
Log: fix touchscreen tap incorrectly triggering context menu when expanding
collapsed notifications
fix: 通知中心分离触摸屏和鼠标右键菜单触发方式
将右键菜单的 TapHandler 拆分为两个独立的处理器,并添加设备过滤,
防止触摸屏点击展开折叠通知时错误地触发右键菜单:
1. 鼠标/其他设备处理器:使用 acceptedDevices 设置为
PointerDevice.AllDevices & ~PointerDevice.TouchScreen 排除触摸屏,
因为 Qt 中触摸屏事件会绕过 acceptedButtons 检查
2. 触摸屏处理器:仅接受来自触摸屏设备的长按手势
这确保了在折叠通知上单指点击只会展开通知而不会显示右键菜单,
同时长按仍然可以按预期触发菜单。
Log: 修复触摸屏点击展开折叠通知时错误触发右键菜单的问题
PMS: BUG-3550171 parent b4328cd commit 2da197f
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
125 | 137 | | |
126 | 138 | | |
127 | 139 | | |
| |||
197 | 209 | | |
198 | 210 | | |
199 | 211 | | |
| 212 | + | |
| 213 | + | |
200 | 214 | | |
201 | 215 | | |
| 216 | + | |
202 | 217 | | |
203 | 218 | | |
204 | 219 | | |
| |||
207 | 222 | | |
208 | 223 | | |
209 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
| |||
0 commit comments