From 5d7ad46fa808353dbaf00d11b5d3f99f353bbb9a Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Sun, 12 Nov 2023 11:11:16 +0700 Subject: [PATCH] Re-introduce a timer to avoid finger hover / stylus interference --- src/qml/qgismobileapp.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qml/qgismobileapp.qml b/src/qml/qgismobileapp.qml index cb8a8bded9..01d9627199 100644 --- a/src/qml/qgismobileapp.qml +++ b/src/qml/qgismobileapp.qml @@ -342,8 +342,8 @@ ApplicationWindow { } onHoveredChanged: { - if (skipHover) { - skipHover = hovered + if ( skipHover ) { + dummyHoverTimer.restart() return } @@ -359,7 +359,17 @@ ApplicationWindow { /* The second hover handler is a workaround what appears to be an issue with * Qt whereas synthesized mouse event would trigger the first HoverHandler even though * PointerDevice.TouchScreen was explicitly taken out of the accepted devices. + * The timer is needed as adding additional fingers onto a device re-triggers hovered + * changes in unpredictable order. */ + Timer { + id: dummyHoverTimer + interval: 100 + repeat: false + + onTriggered: hoverHandler.skipHover = hoverHandler.hovered + } + HoverHandler { id: dummyHoverHandler enabled: !qfieldSettings.mouseAsTouchScreen