unipoll: emit user input-events & uno commands directly when in unipoll mode.
Rather than emitting asynchronously at idle. Change-Id: I6c72e9fad0b5587941e3a4a4d17d331a0d889942 Reviewed-on: https://gerrit.libreoffice.org/71809 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
@@ -2971,10 +2971,13 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
|
||||
|
||||
std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
|
||||
|
||||
beans::PropertyValue aSynchronMode;
|
||||
aSynchronMode.Name = "SynchronMode";
|
||||
aSynchronMode.Value <<= false;
|
||||
aPropertyValuesVector.push_back(aSynchronMode);
|
||||
if (!vcl::lok::isUnipoll())
|
||||
{
|
||||
beans::PropertyValue aSynchronMode;
|
||||
aSynchronMode.Name = "SynchronMode";
|
||||
aSynchronMode.Value <<= false;
|
||||
aPropertyValuesVector.push_back(aSynchronMode);
|
||||
}
|
||||
|
||||
int nView = SfxLokHelper::getView();
|
||||
if (nView < 0)
|
||||
|
@@ -18,6 +18,7 @@ namespace vcl
|
||||
{
|
||||
namespace lok
|
||||
{
|
||||
bool VCL_DLLPUBLIC isUnipoll();
|
||||
void VCL_DLLPUBLIC registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback,
|
||||
LibreOfficeKitWakeCallback pWakeCallback, void* pData);
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <com/sun/star/frame/Desktop.hpp>
|
||||
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <vcl/lok.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/commandevent.hxx>
|
||||
#include <sfx2/app.hxx>
|
||||
@@ -313,7 +314,14 @@ namespace
|
||||
}
|
||||
|
||||
pEvent->mnView = SfxLokHelper::getView(nullptr);
|
||||
Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
|
||||
if (vcl::lok::isUnipoll())
|
||||
{
|
||||
if (!Application::IsMainThread())
|
||||
SAL_WARN("lok", "Posting event directly but not called from main thread!");
|
||||
LOKPostAsyncEvent(pEvent, nullptr);
|
||||
}
|
||||
else
|
||||
Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1675,6 +1675,12 @@ void registerPollCallbacks(
|
||||
}
|
||||
}
|
||||
|
||||
bool isUnipoll()
|
||||
{
|
||||
ImplSVData * pSVData = ImplGetSVData();
|
||||
return pSVData && pSVData->mpPollClosure != nullptr;
|
||||
}
|
||||
|
||||
} } // namespace lok, namespace vcl
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user