summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-02-20 08:14:36 +0100
committerKatarina Behrens <bubli@bubli.org>2020-02-20 15:30:24 +0100
commit2bc83c9691701ffa486babc161e945b285a5d7f1 (patch)
tree2a147bc421a0f99ab6c24e39f6752fd505dfc25b
parenteca9a29eb18048c40e05f6343fc0306f63d23f14 (diff)
tdf#130794 qt5: Actually, ignore non-spontaneous QEvent::ShortcutOverride
In fact, the assumption in commit 034f56015c1c7a61faede33fb5306f63b5585632 ("tdf#126785 qt5: Ignore external QEvent::ShortcutOverride") was a fallacy and it's exactly the other way around: "Normal" typing leads to "spontaneous" events of type QEvent::ShortcutOverride, since those originate from outside, are triggered via X11 events or Wayland equivalent, and the non-spontaneous ones are the additional ones that happen when e.g. the Orca screen reader is enabled. In a short test, no non-spontaneous QEvent::ShortcutOverride ever occured when using LibreOffice a bit with Orca disabled on X11 or Wayland (and on Wayland also not with Orca enabled, since Qt accessibility is broken there, s. QTBUG-73945 [1]). (Side note: In a quick test with Qt 5.12.5 and Plasma on Wayland, 'xcbSourceDispatch' from Qt library's qxcbeventdispatcher.cpp was also used in the Wayland case to when processing the keyboard events). [1] https://bugreports.qt.io/browse/QTBUG-73945 Change-Id: I1be1977e67f84fa657f6fc197e0b91822b6a3a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89073 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 69e708868f6046cada955a16bca966370ce3218a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88961 Reviewed-by: Katarina Behrens <bubli@bubli.org>
-rw-r--r--vcl/qt5/Qt5Widget.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 8c0c5244c2bb..4f596033e724 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -449,12 +449,12 @@ bool Qt5Widget::handleEvent(Qt5Frame& rFrame, const QWidget& rWidget, QEvent* pE
{
if (pEvent->type() == QEvent::ShortcutOverride)
{
- // ignore QEvent::ShortcutOverride events originating from outside the application,
+ // ignore non-spontaneous QEvent::ShortcutOverride events,
// 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)
+ // so that two events of that kind (the "real one" and a non-spontaneous one)
// would otherwise be processed, resulting in duplicate input as 'handleKeyEvent'
// is called below (s. tdf#122053)
- if (pEvent->spontaneous())
+ if (!pEvent->spontaneous())
{
return false;
}