|
|
|
@ -230,8 +230,10 @@ function Device:onPowerEvent(ev)
|
|
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
|
logger.dbg("Suspending...")
|
|
|
|
|
-- Mostly always suspend in Portrait/Inverted Portrait mode...
|
|
|
|
|
-- ... except when we just show an InfoMessage, it plays badly with Landscape mode (c.f., #4098)
|
|
|
|
|
if G_reader_settings:readSetting("screensaver_type") ~= "message" then
|
|
|
|
|
-- ... except when we just show an InfoMessage or when the screensaver
|
|
|
|
|
-- is disabled, as it plays badly with Landscape mode (c.f., #4098 and #5290)
|
|
|
|
|
local screensaver_type = G_reader_settings:readSetting("screensaver_type")
|
|
|
|
|
if screensaver_type ~= "message" and screensaver_type ~= "disable" then
|
|
|
|
|
self.orig_rotation_mode = self.screen:getRotationMode()
|
|
|
|
|
-- Leave Portrait & Inverted Portrait alone, that works just fine.
|
|
|
|
|
if bit.band(self.orig_rotation_mode, 1) == 1 then
|
|
|
|
@ -244,9 +246,8 @@ function Device:onPowerEvent(ev)
|
|
|
|
|
-- 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
|
|
|
|
|
screensaver_type == "cover" or screensaver_type == "random_image" or
|
|
|
|
|
screensaver_type == "image_file" then
|
|
|
|
|
if not G_reader_settings:isTrue("screensaver_no_background") then
|
|
|
|
|
self.screen:clear()
|
|
|
|
|
end
|
|
|
|
|