summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-02-17 10:38:15 +0100
committerKatarina Behrens <bubli@bubli.org>2020-02-18 09:04:28 +0100
commit1260b71c6796f12053cddd4c7a8f3f727fdf1890 (patch)
tree2c63c6c045836349fb5c642339e346b42b6777e1 /vcl/qt5
parentb07ff17bd08d6f864b017732ad62a1a68fcf22c1 (diff)
tdf#126785 qt5: Ignore external QEvent::ShortcutOverride
For some reason, an extra external QEvent::ShortcutOverride event is triggered when a key is pressed and e.g. the Orca screen reader is enabled, which would result in duplicated input when handled as key input event as well. Therefore, ignore those ShortcutOverride events that are "spontaneous", i.e. "the event originated outside the application (a system event)". [1] [1] https://doc.qt.io/qt-5/qevent.html#spontaneous Change-Id: Ibccacb69c31d4d7ebd512c704f0e4df978c5281f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88852 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 034f56015c1c7a61faede33fb5306f63b5585632) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88790 Reviewed-by: Katarina Behrens <bubli@bubli.org>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/Qt5Widget.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 70f480364f57..a17bcb0ca7ce 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -450,6 +450,16 @@ bool Qt5Widget::handleEvent(Qt5Frame& rFrame, const QWidget& rWidget, QEvent* pE
{
if (pEvent->type() == QEvent::ShortcutOverride)
{
+ // ignore QEvent::ShortcutOverride events originating from outside the application,
+ // since such an extra event is sent e.g. with Orca screen reader enabled,
+ // so that two events of that kind (the "real one" and one from outside)
+ // would otherwise be processed, resulting in duplicate input as 'handleKeyEvent'
+ // is called below (s. tdf#122053)
+ if (pEvent->spontaneous())
+ {
+ return false;
+ }
+
// Accepted event disables shortcut activation,
// but enables keypress event.
// If event is not accepted and shortcut is successfully activated,