Remember the final rotation during Reboot/PowerOff/AutoSuspend, too (#7133)

Re #7096, Fix #7125

Co-authored-by: yparitcher <y@paritcher.com>
This commit is contained in:
NiLuJe
2021-01-12 22:31:38 +01:00
committed by GitHub
parent f53fa1d323
commit 47b0d4089a
2 changed files with 6 additions and 4 deletions

View File

@@ -58,7 +58,8 @@ function UIManager:init()
end,
}
self.poweroff_action = function()
self._entered_poweroff_stage = true;
self._entered_poweroff_stage = true
Device.orig_rotation_mode = Device.screen:getRotationMode()
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
require("ui/screensaver"):show("poweroff", _("Powered off"))
if Device:needsScreenRefreshAfterResume() then
@@ -74,7 +75,8 @@ function UIManager:init()
end)
end
self.reboot_action = function()
self._entered_poweroff_stage = true;
self._entered_poweroff_stage = true
Device.orig_rotation_mode = Device.screen:getRotationMode()
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
require("ui/screensaver"):show("reboot", _("Rebooting…"))
if Device:needsScreenRefreshAfterResume() then

View File

@@ -339,8 +339,8 @@ local function exitReader()
-- Save any device settings before closing G_reader_settings
Device:saveSettings()
-- Save current rotation to have it for next startup
G_reader_settings:saveSetting("closed_rotation_mode", Device.screen:getRotationMode())
-- Save current rotation (or the original rotation if ScreenSaver temporarily modified it) to remember it for next startup
G_reader_settings:saveSetting("closed_rotation_mode", Device.orig_rotation_mode or Device.screen:getRotationMode())
G_reader_settings:close()