Skip to content

Commit b7c1e92

Browse files
committed
fix: fix touchscreen double-tap and long-press handling
1. Fixed touchscreen double-tap not maximizing/restoring windows by adding a separate TapHandler for non-mouse devices 2. Fixed touchscreen long-press not showing system window menu by handling it in the non-mouse TapHandler 3. Added device filtering to prevent conflicts between mouse and touchscreen events 4. The original TapHandler now only accepts mouse events with acceptedDevices: PointerDevice.Mouse 5. The new TapHandler accepts all non-mouse devices (touchscreen, stylus, etc.) and handles their gestures Log: Fixed touchscreen double-tap to maximize/restore windows and long- press to show system menu Influence: 1. Test double-tap on touchscreen to maximize and restore windows 2. Test long-press on touchscreen to show system window menu 3. Verify mouse right-click and left-click double-tap still work correctly 4. Test with different input devices (touchscreen, mouse, stylus) to ensure proper device filtering 5. Verify no conflicts between mouse and touchscreen event handling fix: 修复触摸屏双击和长按处理问题 1. 通过为非鼠标设备添加单独的TapHandler修复触摸屏双击无法最大化/还原窗口 的问题 2. 通过在非鼠标TapHandler中处理长按修复触摸屏长按无法显示系统窗口菜单的 问题 3. 添加设备过滤以防止鼠标和触摸屏事件冲突 4. 原TapHandler现在只接受鼠标事件(acceptedDevices: PointerDevice.Mouse) 5. 新的TapHandler接受所有非鼠标设备(触摸屏、手写笔等)并处理其手势 Log: 修复触摸屏双击最大化/还原窗口和长按显示系统菜单功能 Influence: 1. 测试触摸屏双击以最大化和还原窗口 2. 测试触摸屏长按以显示系统窗口菜单 3. 验证鼠标右键和左键双击功能是否正常工作 4. 测试不同输入设备(触摸屏、鼠标、手写笔)以确保正确的设备过滤 5. 验证鼠标和触摸屏事件处理之间没有冲突 PMS: BUG-348313
1 parent 1491884 commit b7c1e92

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

qt6/src/qml/TitleBar.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Item {
5757
}
5858
TapHandler {
5959
acceptedButtons: Qt.RightButton | Qt.LeftButton
60+
acceptedDevices: PointerDevice.AllDevices & ~PointerDevice.TouchScreen
6061
onDoubleTapped: function (eventPoint, button) {
6162
if (button === Qt.LeftButton) {
6263
control.toggleWindowState()
@@ -70,6 +71,15 @@ Item {
7071
}
7172
}
7273
}
74+
TapHandler {
75+
acceptedDevices: PointerDevice.TouchScreen
76+
onDoubleTapped: function () {
77+
control.toggleWindowState()
78+
}
79+
onLongPressed: function () {
80+
__dwindow.popupSystemWindowMenu()
81+
}
82+
}
7383

7484
Loader {
7585
id: background

0 commit comments

Comments
 (0)