From 1ff19f8ba735d207e04de60f4d121ff88a45673b Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 31 Oct 2021 23:50:03 +0100 Subject: [PATCH] Kobo: On sunxi, add a delay between the white flash and the sleep screen. Otherwise, on the Sage, weird flash glitches may happen, depending on what was on screen... (e.g., there's some weird update merging shenanigans going on despite those updates being flagged NO_MERGE...). --- frontend/device/generic/device.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 4d0f40f82..e71f07bef 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -9,7 +9,8 @@ local Geom = require("ui/geometry") local logger = require("logger") local util = require("util") local _ = require("gettext") -local T = require("ffi/util").template +local ffiUtil = require("ffi/util") +local T = ffiUtil.template local function yes() return true end local function no() return false end @@ -307,6 +308,11 @@ function Device:onPowerEvent(ev) self.screen:clear() end self.screen:refreshFull() + + -- On Kobo, on sunxi SoCs with a recent kernel, wait a tiny bit more to avoid weird refresh glitches... + if self:isKobo() and self:isSunxi() then + ffiUtil.usleep(150 * 1000) + end end else -- nil it, in case user switched ScreenSaver modes during our lifetime.