From e582036c3e1ea12d687ec356e45b470f0e2aebe4 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 21 Feb 2021 06:26:04 +0100 Subject: [PATCH] TouchMenu: Workaround an EPDC race in the hold handler w/ flash_ui (#7325) * Also bump base, because it's mildly related https://github.com/koreader/koreader-base/pull/1312 --- base | 2 +- frontend/ui/widget/touchmenu.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/base b/base index d052cd6e0..529d74140 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit d052cd6e0eb129772d02ca85e7961a4ffe6aed28 +Subproject commit 529d74140f5ad4d603e6a5939664a29acbfd770f diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index 2b965e68b..119c5ee0e 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -215,6 +215,12 @@ function TouchMenuItem:onHoldSelect(arg, ges) UIManager:setDirty(nil, "fast", highlight_dimen) UIManager:forceRePaint() + -- NOTE: These very specific circumstances appear to reliably upset the EPDC, + -- causing a mild variant of our racey friend the papercut refresh glitch ;). + -- As it appears to stem from the race between *this* refresh for the highlight and the following writes to the fb, + -- let the kernel take a breather. It'll yield back to us when it's done. + -- Expect it to block for ~150 to 350ms. Given the context (a hold gesture), we can absorb the latency hit mostly unnnoticed. + UIManager:waitForVSync() -- Unhighlight --