[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/qt5

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 17 14:46:20 UTC 2020


 vcl/qt5/Qt5Widget.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit cc4f16ca02c97847d05ee6479ae138a47db148f7
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Mon Feb 17 10:38:15 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Feb 17 15:45:45 2020 +0100

    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 at posteo.de>
    (cherry picked from commit 034f56015c1c7a61faede33fb5306f63b5585632)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88791
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 1fe4b505055f..8c0c5244c2bb 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -449,6 +449,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,


More information about the Libreoffice-commits mailing list