From 4c0518d2d9796c28d38348d105149c9b5411a75b Mon Sep 17 00:00:00 2001 From: Kevin Koenig Date: Thu, 4 Nov 2021 03:57:37 -0700 Subject: [PATCH] Fix continuously touch end events and ensuretouchEnd if no scroll * minor changes to touch and slide processing. set event to TE_NONE so you don't continuously get touch end events. also make sure you get touchEnd if you slid but there is no sliding window (e.g. no scroll happened) * revert slide operations back to their original state * fix merge issue * one more try and it should be right now Co-authored-by: kkoenig1@optonline.com --- radio/src/thirdparty/libopenui/src/mainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/mainwindow.cpp b/radio/src/thirdparty/libopenui/src/mainwindow.cpp index 03241345f..27c459bf2 100644 --- a/radio/src/thirdparty/libopenui/src/mainwindow.cpp +++ b/radio/src/thirdparty/libopenui/src/mainwindow.cpp @@ -47,7 +47,7 @@ void MainWindow::checkEvents() } if(!touchEnabled) - touchState.event = TE_NONE; + touchState.event = TE_NONE; if (touchState.event == TE_DOWN) { onTouchStart(touchState.x + scrollPositionX, touchState.y + scrollPositionY); @@ -81,7 +81,9 @@ void MainWindow::checkEvents() touchState.lastDeltaY = 0; onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, touchState.lastDeltaX, touchState.lastDeltaY); - slidingWindow = nullptr; + } else if (touchState.event == TE_SLIDE_END && slidingWindow == nullptr) { + onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY); + touchState.event = TE_NONE; } #endif