From 1d58eb8b6ccd94dc73233dd558db14b6b9f0627e Mon Sep 17 00:00:00 2001 From: clarkspark Date: Sun, 8 Mar 2020 03:46:46 -0400 Subject: [PATCH] =?UTF-8?q?Correct=20Frontlight=20status=20on=20suspend=20?= =?UTF-8?q?when=20screensaver=20mode=20is=20'Leave=20=E2=80=A6=20(#5928)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also use a var in place of a long function name --- frontend/device/generic/device.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 5379db3d4..5c1c6911f 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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