diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index d4a73f5ee7..8f59eabcee 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -288,6 +288,7 @@ void DisplayApp::RunningState() { LoadApp(returnToApp, returnDirection); } lv_task_handler(); + lvgl.ClearTouch(); } void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) { diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index c069afa2fd..d15fb3b676 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -172,12 +172,19 @@ void LittleVgl::SetNewTapEvent(uint16_t x, uint16_t y) { tapped = true; } +void LittleVgl::ClearTouch() { + if (touchProcessed) { + touchProcessed = false; + tapped = false; + } +} + bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) { + touchProcessed = true; + ptr->point.x = tap_x; + ptr->point.y = tap_y; if (tapped) { - ptr->point.x = tap_x; - ptr->point.y = tap_y; ptr->state = LV_INDEV_STATE_PR; - tapped = false; } else { ptr->state = LV_INDEV_STATE_REL; } diff --git a/src/displayapp/LittleVgl.h b/src/displayapp/LittleVgl.h index 41f934a751..72725552d2 100644 --- a/src/displayapp/LittleVgl.h +++ b/src/displayapp/LittleVgl.h @@ -25,6 +25,7 @@ namespace Pinetime { bool GetTouchPadInfo(lv_indev_data_t* ptr); void SetFullRefresh(FullRefreshDirections direction); void SetNewTapEvent(uint16_t x, uint16_t y); + void ClearTouch(); private: void InitDisplay(); @@ -55,6 +56,7 @@ namespace Pinetime { uint16_t tap_x = 0; uint16_t tap_y = 0; bool tapped = false; + bool touchProcessed = false; }; } }