summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-04-27 13:37:52 +0100
committerJan Holesovsky <kendy@collabora.com>2019-05-06 11:19:33 +0200
commit33bfff357d68a521186a493b31b795b85bde897c (patch)
treefa332d9aebb75a77652de94f779541d3b8546684 /sfx2
parent4eef543e27baacffb23225af1a4d5adcb79cb9a1 (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/71770 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@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 85834534316c..98b76d43514c 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 <sfx2/viewsh.hxx>
#include <sfx2/request.hxx>
@@ -308,7 +309,14 @@ namespace
}
pEvent->mnView = SfxLokHelper::getView(nullptr);
- Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
+ if (vcl::lok::isUnipoll())
+ {
+ if (Application::GetMainThreadIdentifier() != ::osl::Thread::getCurrentIdentifier())
+ SAL_WARN("lok", "Posting event directly but not called from main thread!");
+ LOKPostAsyncEvent(pEvent, nullptr);
+ }
+ else
+ Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
}
}