desktop/source/app/app.cxx | 1 + sc/source/ui/app/scmod.cxx | 1 + sfx2/source/control/bindings.cxx | 1 + sw/source/core/doc/DocumentTimerManager.cxx | 1 + vcl/source/graphic/Manager.cxx | 1 + 5 files changed, 5 insertions(+)
New commits: commit 4f15a47c7faf55997e776af738106d3da229c7d2 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Feb 17 16:47:08 2025 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Feb 18 09:40:52 2025 +0100 cool#11064 Set priority of some idles to TaskPriority::DEFAULT_IDLE LOK clients can set their "any input" callback to interrupt idle jobs when they have something to execute which is less important that core "high priority" jobs but is more important than "low priority" jobs. For example calculating the layout for the visible area of a just changed Writer document is high priority, while calculating the non-visible area is low priority. Experimenting with an upcoming change to only interrupt the scheduler tasks when there are no high priority tasks scheduled, I noticed a number of idles which have a default priority, which is rather high: TaskPriority::DEFAULT is higher than a repaint priority. Fix the problem by checking what idles prevent the early paint of the visible area in Writer in LOK client code and by downgrading the priority of these idles to TaskPriority::DEFAULT_IDLE. With this, the "early paint of the visible Writer area" feature in LOK client code continues to work, even if the any input callback starts to not interrupt for the case when there are TaskPriority::HIGHEST..TaskPriority::REPAINT tasks in the scheduler, ready to be invoked. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181794 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Change-Id: I42b3e0adbad98ef992ee3a454aba431a662a8126 diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cb4a4de7db9e..91a34ed8b56b 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -446,6 +446,7 @@ Desktop::Desktop() , m_aBootstrapStatus(BS_OK) , m_firstRunTimer( "desktop::Desktop m_firstRunTimer" ) { + m_firstRunTimer.SetPriority(TaskPriority::DEFAULT_IDLE); m_firstRunTimer.SetTimeout(3000); // 3 sec. m_firstRunTimer.SetInvokeHandler(LINK(this, Desktop, AsyncInitFirstRun)); } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index e5f940bbbe34..99019917cd5b 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -143,6 +143,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) : ErrCodeArea::Sc, GetResLocale()) ); + m_aIdleTimer.SetPriority(TaskPriority::DEFAULT_IDLE); m_aIdleTimer.SetTimeout(SC_IDLE_MIN); m_aIdleTimer.SetInvokeHandler( LINK( this, ScModule, IdleHandler ) ); m_aIdleTimer.Start(); diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 718df9bd9887..744a3dc1a7b4 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -146,6 +146,7 @@ SfxBindings::SfxBindings() pImpl->pSubBindings = nullptr; pImpl->nOwnRegLevel = nRegLevel; + pImpl->aAutoTimer.SetPriority(TaskPriority::DEFAULT_IDLE); // all caches are valid (no pending invalidate-job) // create the list of caches pImpl->aAutoTimer.SetPriority(TaskPriority::HIGH_IDLE); diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx index 44df4c33729d..df232238eca0 100644 --- a/sw/source/core/doc/DocumentTimerManager.cxx +++ b/sw/source/core/doc/DocumentTimerManager.cxx @@ -49,6 +49,7 @@ DocumentTimerManager::DocumentTimerManager(SwDoc& i_rSwdoc) m_aDocIdle.SetPriority(TaskPriority::LOWEST); m_aDocIdle.SetInvokeHandler(LINK(this, DocumentTimerManager, DoIdleJobs)); + m_aFireIdleJobsTimer.SetPriority(TaskPriority::DEFAULT_IDLE); m_aFireIdleJobsTimer.SetInvokeHandler(LINK(this, DocumentTimerManager, FireIdleJobsTimeout)); m_aFireIdleJobsTimer.SetTimeout(1000); // Enough time for LOK to render the first tiles. } diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index fb316aef153d..fc7c39b94f0d 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -58,6 +58,7 @@ MemoryManager::MemoryManager() if (mbSwapEnabled) { + maSwapOutTimer.SetPriority(TaskPriority::DEFAULT_IDLE); maSwapOutTimer.SetInvokeHandler(LINK(this, MemoryManager, ReduceMemoryTimerHandler)); maSwapOutTimer.SetTimeout(mnTimeout); maSwapOutTimer.Start();