svtools/source/misc/acceleratorexecute.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
New commits: commit 672bd35287447e6d89cdfe5b6c1cd2b4688278fe Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Mon Feb 3 22:47:34 2020 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Tue Feb 4 10:51:48 2020 +0100 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Meeks <michael.me...@collabora.com> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits