From: Sebastian Keller Date: Wed, 25 May 2022 12:56:05 +0000 (+0200) Subject: a11y: Realize GtkStackPage parent context before trying to get a ref X-Git-Tag: archive/raspbian/4.7.2+ds-3+rpi1^2^2~15^2~1^2~5^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1860da7a1a57efc5e03f06c40dc99a0242f41748;p=gtk4.git a11y: Realize GtkStackPage parent context before trying to get a ref If a context is not realized, calling gtk_at_spi_context_to_ref() will return a null ref, because its path has not been initialized yet. This was already done for all other cases in get_parent_context_ref(), but was missing for the GtkStackPage case. Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4944 --- diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index 7c49929aff..a0086365c4 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -436,7 +436,11 @@ get_parent_context_ref (GtkAccessible *accessible) gtk_accessible_get_at_context (GTK_ACCESSIBLE (parent)); if (parent_context != NULL) - res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context)); + { + gtk_at_context_realize (parent_context); + + res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context)); + } } if (res == NULL)