[Libreoffice-commits] core.git: svtools/source
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 4 19:00:29 UTC 2020
svtools/source/misc/acceleratorexecute.cxx | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
New commits:
commit 80a1c69a30a55ed648a43976f6ab401ac2b5ceaa
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Feb 3 22:47:34 2020 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Feb 4 19:59:58 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/+/87929
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
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;
More information about the Libreoffice-commits
mailing list