mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)
When a gesture/profile was updating multiple cre settings, each setting handler would emit UpdatePos which each would force a re-rendering. When this might be happening, postpone the rerendering until all are set. Needs some bit of refactoring to the events at play: introduce "DocumentRerendered" event, and use it where we used "UpdatePos" or "UpdateToc" to mean exactly that.
This commit is contained in:
@@ -99,11 +99,12 @@ end
|
||||
function ReaderToc:onUpdateToc()
|
||||
self:resetToc()
|
||||
self.ui:handleEvent(Event:new("TocReset"))
|
||||
|
||||
--- @note: Let this propagate, plugins/statistics uses it to react to changes in document pagination
|
||||
--return true
|
||||
return true
|
||||
end
|
||||
|
||||
-- Be sure to update the ToC after a CRE rerendering
|
||||
ReaderToc.onDocumentRerendered = ReaderToc.onUpdateToc
|
||||
|
||||
function ReaderToc:onPageUpdate(pageno)
|
||||
if UIManager.FULL_REFRESH_COUNT == -1 or G_reader_settings:isTrue("refresh_on_chapter_boundaries") then
|
||||
local flash_on_second = G_reader_settings:nilOrFalse("no_refresh_on_second_chapter_page")
|
||||
|
||||
Reference in New Issue
Block a user