screensaver: add option to reduce cover sleep screen ghosting (#15568)

Adds 'Extra flash' setting that refreshes the cover image twice after
  it is shown, reducing ghosting on affected devices (e.g. Kobo Libra 2).
  Fixes #12950
This commit is contained in:
Ahmed El Yaacoub authored and GitHub committed 2026-06-22 21:02:46 +02:00
1 parent 80f0d16e56
commit 40f34e1d09
3 files changed
+20

No files matched your search

+2
View File
@@ -36,6 +36,8 @@ local Device = {
-- For Kobo, wait at least 15 seconds before calling suspend script. Otherwise, suspend might
-- fail and the battery will be drained while we are in screensaver mode
suspend_wait_timeout = 15,
-- Bumped when screensaver_extra_flash is enabled, to account for ~2s of extra refresh activity
suspend_wait_timeout_extra_flash = 17,
-- hardware feature tests: (these are functions!)
hasBattery = yes,
@@ -22,6 +22,14 @@ local eink_settings_table = {
G_reader_settings:flipNilOrFalse("avoid_flashing_ui")
end,
},
{
text = _("Double flash sleep screen"),
help_text = _("Flash the sleep screen twice after it is shown to reduce ghosting. May not be needed on all devices."),
checked_func = function() return G_reader_settings:isTrue("screensaver_extra_flash") end,
callback = function()
G_reader_settings:flipNilOrFalse("screensaver_extra_flash")
end,
},
},
}
+10
View File
@@ -659,6 +659,16 @@ function Screensaver:show()
self.screensaver_widget.dithered = true
UIManager:show(self.screensaver_widget, "full")
if G_reader_settings:isTrue("screensaver_extra_flash") then
Device.suspend_wait_timeout = Device.suspend_wait_timeout_extra_flash
local screen_w2, screen_h2 = Screen:getWidth(), Screen:getHeight()
UIManager:scheduleIn(0.5, function()
Screen:refreshFull(0, 0, screen_w2, screen_h2)
end)
UIManager:scheduleIn(1.5, function()
Screen:refreshFull(0, 0, screen_w2, screen_h2)
end)
end
end
-- Setup the gesture lock through an additional invisible widget, so that it works regardless of the configuration.