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

New commits:
commit 034f56015c1c7a61faede33fb5306f63b5585632
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 17 10:38:15 2020 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 17 12:40:46 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.wegh...@posteo.de>

diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 5073dbff1a82..0bca51ea55c8 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,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to