diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-02-03 22:47:34 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-02-04 19:59:58 +0100 |
commit | 80a1c69a30a55ed648a43976f6ab401ac2b5ceaa (patch) | |
tree | a9bef8aabb73508352207ded2e282a527fcee334 /svtools/source | |
parent | 7d5a463684b44b625bf555c1d8ed4df5a1660339 (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/source')
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 3648e200e7c2..b1ed64352fbf 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 @@ -201,8 +205,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; |