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

Re #7096, Fix #7125

Co-authored-by: yparitcher <y@paritcher.com>
reviewable/pr7137/r1
NiLuJe 3 years ago committed by GitHub
parent f53fa1d323
commit 47b0d4089a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save