summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-04-27 13:37:52 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-05-07 11:30:10 +0200
commit37a19f781d4e4f0fa1c6abf4679d222213bbddfb (patch)
tree206970f29cd6c9bd70246c578f328f8f34ce80e9 /sfx2
parentf1ed27eed68228edbab5eb63951a602263e4c3a7 (diff)
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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/lokhelper.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 9e9b9ab53e82..a7828287205d 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -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));
}
}