Skip to content

Commit

Permalink
Re-introduce a timer to avoid finger hover / stylus interference
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Nov 12, 2023
1 parent cb6f9e5 commit 5d7ad46
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ ApplicationWindow {
}

onHoveredChanged: {
if (skipHover) {
skipHover = hovered
if ( skipHover ) {
dummyHoverTimer.restart()
return
}

Expand All @@ -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
Expand Down

1 comment on commit 5d7ad46

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.