Correct Frontlight status on suspend when screensaver mode is 'Leave … (#5928)

Also use a var in place of a long function name
reviewable/pr5931/r1 v2020.03
clarkspark 4 years ago committed by GitHub
parent da8151f84a
commit 1d58eb8b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save