diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 4fd82c78e..8e11f4ca7 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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, diff --git a/frontend/ui/elements/screen_eink_opt_menu_table.lua b/frontend/ui/elements/screen_eink_opt_menu_table.lua index d1fdccfec..ead39962f 100644 --- a/frontend/ui/elements/screen_eink_opt_menu_table.lua +++ b/frontend/ui/elements/screen_eink_opt_menu_table.lua @@ -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, + }, }, } diff --git a/frontend/ui/screensaver.lua b/frontend/ui/screensaver.lua index 6bf12a6b2..ee6c345d8 100644 --- a/frontend/ui/screensaver.lua +++ b/frontend/ui/screensaver.lua @@ -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.