a11y: Fix the logic in gtk_accessible_get_next_accessible_sibling which
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 16 Mar 2023 14:16:32 +0000 (15:16 +0100)
committerLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 16 Mar 2023 14:16:32 +0000 (15:16 +0100)
decided whether we will use the overridden sibling on the context.

gtk/gtkaccessible.c

index 873094a4745f5a5066f5aaa0ff38036c8fa21e21..16bafe3fb765ecfdbe509f0a621d51b5307a546d 100644 (file)
@@ -251,16 +251,13 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self)
   GtkATContext *context;
 
   context = gtk_accessible_get_at_context (self);
-  if (context != NULL)
+  if (context != NULL && gtk_at_context_get_accessible_parent (context) != NULL)
     {
       GtkAccessible *sibling = NULL;
 
-      if (gtk_at_context_get_accessible_parent (context) != NULL)
-        {
-          sibling = gtk_at_context_get_next_accessible_sibling (context);
-          if (sibling != NULL)
-            sibling = g_object_ref (sibling);
-        }
+      sibling = gtk_at_context_get_next_accessible_sibling (context);
+      if (sibling != NULL)
+        sibling = g_object_ref (sibling);
 
       g_object_unref (context);