summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-02-03 22:47:34 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-05-09 15:10:02 +0100
commit17bdf11cbb359609f9f8d3ee17fdae2a517200ca (patch)
tree3cd5aef32eceb21f752f182445bd1671ee214341 /svtools
parentacaa39b86549f303af7ff60a3531ca1c7da1fb81 (diff)
tdf#130382 - process key-event handlers synchronously for unipoll.
Unipoll tries to simplify behavior of the Kit process by processing events in a single thread, more sensibly. We do this for other key events, so it's important that key-derived dispatches eg. SID_BACKSPACE which we use to simulate composition input are also synchronous. Change-Id: I12dbb104419a0aecd184ec312bfadec3a947d48b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87929 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index a9e44ba6a9f8..fc42ef7b415d 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -33,6 +33,10 @@
#include <cppuhelper/implbase.hxx>
#include <vcl/evntpost.hxx>
+#include <sal/log.hxx>
+#include <vcl/lok.hxx>
+#include <vcl/window.hxx>
+#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
namespace svt
@@ -198,8 +202,21 @@ bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey)
{
// Note: Such instance can be used one times only and destroy itself afterwards .-)
css::uno::Reference<css::lang::XComponent> xFrame(xProvider, css::uno::UNO_QUERY);
- AsyncAccelExec* pExec = AsyncAccelExec::createOneShotInstance(xFrame, xDispatch, aURL);
- pExec->execAsync();
+ if (vcl::lok::isUnipoll())
+ { // tdf#130382 - all synchronous really.
+ try {
+ xDispatch->dispatch (aURL, css::uno::Sequence< css::beans::PropertyValue >());
+ }
+ catch(const css::uno::Exception&ev)
+ {
+ SAL_INFO("svtools", "exception on key emission: " << ev.Message);
+ }
+ }
+ else
+ {
+ AsyncAccelExec* pExec = AsyncAccelExec::createOneShotInstance(xFrame, xDispatch, aURL);
+ pExec->execAsync();
+ }
}
return bRet;