mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
ScreenSaver: On race-y platforms, only force a refresh on close if the
widget was actually closed *immediately*. If it's delayed (by time, tap or gesture), leave it alone. Fix #9285
This commit is contained in:
parent
8e7dddd927
commit
e3228abb19
@ -273,8 +273,8 @@ function Device:onPowerEvent(ev)
|
||||
end
|
||||
end
|
||||
self:resume()
|
||||
Screensaver:close()
|
||||
if self:needsScreenRefreshAfterResume() then
|
||||
local widget_was_closed = Screensaver:close()
|
||||
if widget_was_closed and self:needsScreenRefreshAfterResume() then
|
||||
UIManager:scheduleIn(1, function() self.screen:refreshFull() end)
|
||||
end
|
||||
self.screen_saver_mode = false
|
||||
|
@ -273,10 +273,12 @@ function Kindle:outofScreenSaver()
|
||||
if self.screen_saver_mode == true then
|
||||
if self:supportsScreensaver() then
|
||||
local Screensaver = require("ui/screensaver")
|
||||
Screensaver:close()
|
||||
-- And redraw everything in case the framework managed to screw us over...
|
||||
local UIManager = require("ui/uimanager")
|
||||
UIManager:nextTick(function() UIManager:setDirty("all", "full") end)
|
||||
local widget_was_closed = Screensaver:close()
|
||||
if widget_was_closed then
|
||||
-- And redraw everything in case the framework managed to screw us over...
|
||||
local UIManager = require("ui/uimanager")
|
||||
UIManager:nextTick(function() UIManager:setDirty("all", "full") end)
|
||||
end
|
||||
else
|
||||
-- Stop awesome again if need be...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
|
@ -776,6 +776,9 @@ function Screensaver:close()
|
||||
self.delayed_close = true
|
||||
elseif screensaver_delay == "disable" then
|
||||
self:close_widget()
|
||||
-- NOTE: Notify platforms that race with the native system (e.g., Kindle or needsScreenRefreshAfterResume)
|
||||
-- that we've actually closed the widget *right now*.
|
||||
return true
|
||||
elseif screensaver_delay == "gesture" then
|
||||
if self.screensaver_widget then
|
||||
self.screensaver_widget:showWaitForGestureMessage()
|
||||
|
Loading…
Reference in New Issue
Block a user