UIManager: Don't lose track of the original rotation on reboot/poweroff (#9606)

And, actually, stop enforcing Portrait; Screensaver already handles
rotation as necessary depending on the exact screensaver mode.

Fix https://www.mobileread.com/forums/showthread.php?t=349522
This commit is contained in:
NiLuJe
2022-10-07 22:53:10 +02:00
committed by GitHub
parent c0dffe2012
commit 93ae341823

View File

@@ -61,9 +61,7 @@ function UIManager:init()
self.poweroff_action = function()
self._entered_poweroff_stage = true
logger.info("Powering off the device...")
Device.orig_rotation_mode = Device.screen:getRotationMode()
self:broadcastEvent(Event:new("Close"))
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
local Screensaver = require("ui/screensaver")
Screensaver:setup("poweroff", _("Powered off"))
Screensaver:show()
@@ -76,9 +74,7 @@ function UIManager:init()
self.reboot_action = function()
self._entered_poweroff_stage = true
logger.info("Rebooting the device...")
Device.orig_rotation_mode = Device.screen:getRotationMode()
self:broadcastEvent(Event:new("Close"))
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
local Screensaver = require("ui/screensaver")
Screensaver:setup("reboot", _("Rebooting…"))
Screensaver:show()