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 231e027663077c565c1fc48c4c608235160fad14
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 12:50:07 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.
    
    Change-Id: I42b3e0adbad98ef992ee3a454aba431a662a8126
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181824
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 789dedf24673..a89467ca9860 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 26e40a2d3d9a..083eafb0c745 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 89da50718b37..d8dd9c0d159d 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();

Reply via email to