vcl/qt5/QtAccessibleEventListener.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit be8b031d8b3c66b223ea2478f1129427f3a362bd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Sep 7 09:51:38 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Sep 7 13:24:08 2023 +0200

    qt a11y: Forward CHILD event for removed child
    
    No longer comment out the code to send a
    `QAccessible::ObjectDestroyed` event when
    receiving an `AccessibleEventId::CHILD` event with
    its `OldValue` set.
    
    The underlying issues causing crashes previously seem
    to be fixed, I can no longer reproduce these on Debian
    testing with Orca 44.1-2 when using the font color
    popup as described in
    
        commit 734d10ed3612d75edcee145475ddd0b0165efeac
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Apr 14 16:57:09 2023 +0300
    
            qt a11y: Send QAccessible::ObjectCreated event for correct object
    
    > Adapting this for the case where a child has
    > been removed (bridged to Qt as `QAccessible::ObjectDestroyed`
    > event) would currently results in crashes when closing the
    > application e.g. after using the character font color popup in
    > the Writer toolbar. This needs further investigation, so don't
    > send the event for now, but add a `SAL_WARN`.
    
    Change-Id: Ib8f21850dd56645cf64a74be0e1ff8242615b928
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156647
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtAccessibleEventListener.cxx 
b/vcl/qt5/QtAccessibleEventListener.cxx
index 951286a6c1c1..c5d64d4650ed 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -216,16 +216,8 @@ void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::Accessible
             }
             if (aEvent.OldValue >>= xChild)
             {
-                // Forwarding as QAccessible::ObjectDestroyed event currently 
results in crashes on close
-                // e.g. after using the character font color popup in the 
Writer toolbar, which
-                // needs further investigation, so don't send the event for 
now.
-                /*
-                QAccessible::updateAccessibility(
-                    new 
QAccessibleEvent(QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectDestroyed));
-                */
-                SAL_WARN("vcl.qt",
-                         "Not forwarding AccessibleEventId::CHILD event for 
removed child "
-                         "since it may cause crashes.");
+                QAccessible::updateAccessibility(new QAccessibleEvent(
+                    QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectDestroyed));
                 return;
             }
             SAL_WARN("vcl.qt",

Reply via email to