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 10:51:48 +0100 |
commit | 672bd35287447e6d89cdfe5b6c1cd2b4688278fe (patch) | |
tree | 1091f962a985346c7bff14478dfcea2ee56978dd /svtools | |
parent | e40fd1a115e6aa40b203c37387566400e074f8a4 (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/+/87928
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 60e831a5b2cb..400bc6526e00 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -34,6 +34,8 @@ #include <com/sun/star/util/URLTransformer.hpp> #include <cppuhelper/implbase.hxx> +#include <sal/log.hxx> +#include <vcl/lok.hxx> #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -201,8 +203,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; |