vcl/unx/gtk3/a11y/atkwrapper.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit f0827c392641b45647241b3a22e24a95e2b595e3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Aug 19 16:13:04 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Aug 19 20:37:15 2022 +0200

    Resolves: tdf#150496 we want the AtkObject get_parent function
    
    GtkAccessible overrode it, but we expect the AtkObject implementation
    
    Change-Id: I5064bc619b11052bd22f9c75043b3e42697ebfc1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138558
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 9372942054e8..f798364e2003 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -663,6 +663,13 @@ atk_object_wrapper_class_init (AtkObjectWrapperClass 
*klass)
   atk_class->get_index_in_parent = wrapper_get_index_in_parent;
   atk_class->ref_relation_set = wrapper_ref_relation_set;
   atk_class->ref_state_set = wrapper_ref_state_set;
+
+  AtkObjectClass* orig_atk_klass = 
static_cast<AtkObjectClass*>(g_type_class_ref(ATK_TYPE_OBJECT));
+  // tdf#150496 we want to inherit from GtkAccessible because gtk assumes it 
can cast to GtkAccessible
+  // but we want the original behaviour we got from atk_object_real_get_parent 
when we inherited
+  // from AtkObject
+  atk_class->get_parent = orig_atk_klass->get_parent;
+  g_type_class_unref(orig_atk_klass);
 }
 
 static void

Reply via email to