mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
Clear ongoing taps when going to sleep
This commit is contained in:
parent
8598142c27
commit
ebe20c2117
|
@ -314,6 +314,10 @@ void DisplayApp::Refresh() {
|
||||||
} else {
|
} else {
|
||||||
lcd.Sleep();
|
lcd.Sleep();
|
||||||
}
|
}
|
||||||
|
// Clear any ongoing touch pressed events
|
||||||
|
// Without this LVGL gets stuck in the pressed state and will keep refreshing the
|
||||||
|
// display activity timer causing the screen to never sleep after timeout
|
||||||
|
lvgl.ClearTouchState();
|
||||||
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
|
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
|
||||||
state = States::Idle;
|
state = States::Idle;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -248,6 +248,8 @@ void LittleVgl::SetNewTouchPoint(int16_t x, int16_t y, bool contact) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cancel an ongoing tap
|
||||||
|
// Signifies that LVGL should not handle the current tap
|
||||||
void LittleVgl::CancelTap() {
|
void LittleVgl::CancelTap() {
|
||||||
if (tapped) {
|
if (tapped) {
|
||||||
isCancelled = true;
|
isCancelled = true;
|
||||||
|
@ -255,6 +257,13 @@ void LittleVgl::CancelTap() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear the current tapped state
|
||||||
|
// Signifies that touch input processing is suspended
|
||||||
|
void LittleVgl::ClearTouchState() {
|
||||||
|
touchPoint = {-1, -1};
|
||||||
|
tapped = false;
|
||||||
|
}
|
||||||
|
|
||||||
bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
|
bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
|
||||||
ptr->point.x = touchPoint.x;
|
ptr->point.x = touchPoint.x;
|
||||||
ptr->point.y = touchPoint.y;
|
ptr->point.y = touchPoint.y;
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace Pinetime {
|
||||||
void SetFullRefresh(FullRefreshDirections direction);
|
void SetFullRefresh(FullRefreshDirections direction);
|
||||||
void SetNewTouchPoint(int16_t x, int16_t y, bool contact);
|
void SetNewTouchPoint(int16_t x, int16_t y, bool contact);
|
||||||
void CancelTap();
|
void CancelTap();
|
||||||
|
void ClearTouchState();
|
||||||
|
|
||||||
bool GetFullRefresh() {
|
bool GetFullRefresh() {
|
||||||
bool returnValue = fullRefresh;
|
bool returnValue = fullRefresh;
|
||||||
|
|
Loading…
Reference in a new issue