diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-19 14:27:30 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-19 15:20:56 +0000 |
commit | 8fa58c2e178e045769188d2fa55229d67b8d8e79 (patch) | |
tree | 386950c490c3d4a41bb035b2676869adfb4e0efc /gtk/gtkaccessible.c | |
parent | d436c2e8391bc684da933008d5a4483cbc536bc8 (diff) | |
download | gtk+-8fa58c2e178e045769188d2fa55229d67b8d8e79.tar.gz |
a11y: Get the accessible role once
Simplify getting the accessible role when checking if an accessible
implementation should present itself; this avoids going through
GtkAccessible twice to get the same data.
Diffstat (limited to 'gtk/gtkaccessible.c')
-rw-r--r-- | gtk/gtkaccessible.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c index 991bc02756..ed89fa9714 100644 --- a/gtk/gtkaccessible.c +++ b/gtk/gtkaccessible.c @@ -756,14 +756,16 @@ gtk_accessible_bounds_changed (GtkAccessible *self) gboolean gtk_accessible_should_present (GtkAccessible *self) { + GtkAccessibleRole role; GtkATContext *context; if (GTK_IS_WIDGET (self) && !gtk_widget_get_visible (GTK_WIDGET (self))) return FALSE; - if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE || - gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_PRESENTATION) + role = gtk_accessible_get_accessible_role (self); + if (role == GTK_ACCESSIBLE_ROLE_NONE || + role == GTK_ACCESSIBLE_ROLE_PRESENTATION) return FALSE; context = gtk_accessible_get_at_context (self); |