summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-08-14 09:14:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2024-08-14 11:17:33 +0200
commita22fe103e7a26270b7213448c570400a563c18ba (patch)
tree90a80e9b0dff895a5ca3c76075c80c0c7d04255e /desktop/source
parentd27a88f4fed168068bce5fc36d0bf62301641e25 (diff)
Related: cool#9735 vcl lok: add an AnyInput() callback
Open the 300 pages bugdoc, paste a oneliner plain text content in a paragraph which is part of a numbered list, observe a 274 ms hang till layout is done for all pages, then we get an updated tile. This could be better, there is no such hang in the desktop case. What happens is that 1) vcl doesn't try to invoke the poll callback of the LOK client when there was a processed timer and 2) Writer layout doesn't try to split its work into pieces because the LOK client has no way to inform vcl that it has pending input events. Fix the first problem in this commit: add a new API that allows a LOK client to inform vcl that it has pending input events and use that SvpSalInstance::ImplYield(): if a LOK client has pending input events, then invoke the poll callback after each processed timer. For example, this allows the LOK client to process emitted callbacks between two idle layout jobs, word counting, etc. The second problem around Writer to use comphelper::LibreOfficeKit::anyInput() is not yet fixed. Change-Id: I2e39253bfc4d1b5546bc60eef9ff05ccdc0868b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171846 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index be7b370ab56f..71f27c395d33 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2584,6 +2584,10 @@ static void lo_runLoop(LibreOfficeKit* pThis,
LibreOfficeKitWakeCallback pWakeCallback,
void* pData);
+static void lo_registerAnyInputCallback(LibreOfficeKit* pThis,
+ LibreOfficeKitAnyInputCallback pAnyInputCallback,
+ void* pData);
+
static void lo_sendDialogEvent(LibreOfficeKit* pThis,
unsigned long long int nLOKWindowId,
const char* pArguments);
@@ -2630,6 +2634,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl()
m_pOfficeClass->startThreads = lo_startThreads;
m_pOfficeClass->setForkedChild = lo_setForkedChild;
m_pOfficeClass->extractDocumentStructureRequest = lo_extractDocumentStructureRequest;
+ m_pOfficeClass->registerAnyInputCallback = lo_registerAnyInputCallback;
gOfficeClass = m_pOfficeClass;
}
@@ -7705,6 +7710,14 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
#endif
}
+static void lo_registerAnyInputCallback(LibreOfficeKit* /*pThis*/,
+ LibreOfficeKitAnyInputCallback pAnyInputCallback,
+ void* pData)
+{
+ SolarMutexGuard aGuard;
+ comphelper::LibreOfficeKit::setAnyInputCallback(pAnyInputCallback, pData);
+}
+
static bool bInitialized = false;
static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent, const char* pText)