summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2025-02-17 16:47:08 +0100
committerMiklos Vajna <vmiklos@collabora.com>2025-02-18 12:50:07 +0100
commit231e027663077c565c1fc48c4c608235160fad14 (patch)
treeec4256a36ca28aae93e51e193bc195a73be1a801 /desktop
parentb5510122fd68e3d16117684f51062dfb03961b85 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx1
1 files changed, 1 insertions, 0 deletions
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));
}