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:
@@ -101,10 +101,10 @@ function ReaderDogear:updateDogearOffset()
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderDogear:onUpdatePos()
|
||||
function ReaderDogear:onDocumentRerendered()
|
||||
-- Catching the top status bar toggling with :onSetStatusLine()
|
||||
-- would be too early. But "UpdatePos" is sent after it has
|
||||
-- been applied
|
||||
-- would be too early. But "DocumentRerendered" is sent after
|
||||
-- it has been applied
|
||||
self:updateDogearOffset()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user