mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
PM: Optimize task queue handling around standby (#10203)
Instead of firing on(Enter|Leave)Standby Events, and having every other piece of code that might care about that handle re-scheduling their stuff themselves; simply make the standby implementation (i.e., AutoSuspend's) shift the whole task queue by the amount of time spent in standby to re-sync everything automatically. (This is necessary in the first place because Linux, as the task queue ticks in CLOCK_MONOTONIC, which does *not* tick during suspend/standby; while we expect most of the tasks scheduled to actually reflect real world clock delays).
This commit is contained in:
@@ -2471,21 +2471,12 @@ function ReaderFooter:onOutOfScreenSaver()
|
||||
self:rescheduleFooterAutoRefreshIfNeeded()
|
||||
end
|
||||
|
||||
function ReaderFooter:onLeaveStandby()
|
||||
self:maybeUpdateFooter()
|
||||
self:rescheduleFooterAutoRefreshIfNeeded()
|
||||
end
|
||||
|
||||
function ReaderFooter:onSuspend()
|
||||
self:unscheduleFooterAutoRefresh()
|
||||
-- Reset the initial marker
|
||||
self.progress_bar.inital_percentage = nil
|
||||
end
|
||||
|
||||
function ReaderFooter:onEnterStandby()
|
||||
self:unscheduleFooterAutoRefresh()
|
||||
end
|
||||
|
||||
function ReaderFooter:onCloseDocument()
|
||||
self:unscheduleFooterAutoRefresh()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user