mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
a11y: Implement get_name() instead of setting variables
This avoids a later free of this const value.
This commit is contained in:
parent
1205e3b043
commit
f260affbb8
@ -44,7 +44,6 @@ gtk_toplevel_accessible_initialize (AtkObject *accessible,
|
||||
ATK_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->initialize (accessible, data);
|
||||
|
||||
accessible->role = ATK_ROLE_APPLICATION;
|
||||
accessible->name = g_get_prgname ();
|
||||
accessible->accessible_parent = NULL;
|
||||
}
|
||||
|
||||
@ -87,6 +86,12 @@ gtk_toplevel_accessible_ref_child (AtkObject *obj,
|
||||
return atk_obj;
|
||||
}
|
||||
|
||||
static const char *
|
||||
gtk_toplevel_accessible_get_name (AtkObject *obj)
|
||||
{
|
||||
return g_get_prgname ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_combo_window (GtkWidget *widget)
|
||||
{
|
||||
@ -143,6 +148,7 @@ gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
|
||||
class->get_n_children = gtk_toplevel_accessible_get_n_children;
|
||||
class->ref_child = gtk_toplevel_accessible_ref_child;
|
||||
class->get_parent = NULL;
|
||||
class->get_name = gtk_toplevel_accessible_get_name;
|
||||
|
||||
g_object_class->finalize = gtk_toplevel_accessible_object_finalize;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user