Skip to content

Commit

Permalink
[fix] Eliminate ghosting on eInk when showing an image ScreenSaver (k…
Browse files Browse the repository at this point in the history
…oreader#4591)

* Flash a white screen before showing a screensaver image, to prevent
ghosting.

* Really limit the white flash to full-screen images

* Limit that behavior to eInk screens

(Not that clear() is implemented anywhere else, but, still).
  • Loading branch information
NiLuJe authored and mwoz123 committed Mar 29, 2020
1 parent 1ab2bc3 commit b45203b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/device/generic/device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function Device:onPowerEvent(ev)
logger.dbg("Already in screen saver mode, suspending...")
self:rescheduleSuspend()
end
-- else we we not in screensaver mode
-- else we were not in screensaver mode
elseif ev == "Power" or ev == "Suspend" then
self.powerd:beforeSuspend()
local UIManager = require("ui/uimanager")
Expand All @@ -186,6 +186,16 @@ function Device:onPowerEvent(ev)
if G_reader_settings:readSetting("screensaver_type") ~= "message" then
self.orig_rotation_mode = self.screen:getRotationMode()
self.screen:setRotationMode(0)

-- On eInk, if we're using a screensaver mode that shows an image,
-- flash the screen to white first, to eliminate ghosting.
if self:hasEinkScreen() and
G_reader_settings:readSetting("screensaver_type") == "cover" or
G_reader_settings:readSetting("screensaver_type") == "random_image" or
G_reader_settings:readSetting("screensaver_type") == "image_file" then
self.screen:clear(self.screen:getScreenWidth(), self.screen:getScreenHeight())
self.screen:refreshFull()
end
else
-- nil it, in case user switched ScreenSaver modes during our lifetime.
self.orig_rotation_mode = nil
Expand Down

0 comments on commit b45203b

Please sign in to comment.