mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
atcontext: Factor out some code
Move the code that realizes an AT context if the parent is realized, into to a separate function. This will make the next patch easier to read. No functional changes.
This commit is contained in:
parent
c2417dc107
commit
7d0cb2f006
@ -512,6 +512,17 @@ gtk_at_context_get_accessible_parent (GtkATContext *self)
|
||||
|
||||
static GtkATContext * get_parent_context (GtkATContext *self);
|
||||
|
||||
static inline void
|
||||
maybe_realize_context (GtkATContext *self)
|
||||
{
|
||||
GtkATContext *parent_context = get_parent_context (self);
|
||||
|
||||
if (parent_context && parent_context->realized)
|
||||
gtk_at_context_realize (self);
|
||||
|
||||
g_clear_object (&parent_context);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gtk_at_context_set_accessible_parent:
|
||||
* @self: a `GtkAtContext`
|
||||
@ -534,15 +545,10 @@ gtk_at_context_set_accessible_parent (GtkATContext *self,
|
||||
self->accessible_parent = parent;
|
||||
if (self->accessible_parent != NULL)
|
||||
{
|
||||
GtkATContext *parent_context = NULL;
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (self->accessible_parent),
|
||||
(gpointer *) &self->accessible_parent);
|
||||
|
||||
parent_context = get_parent_context (self);
|
||||
if (parent_context && parent_context->realized)
|
||||
gtk_at_context_realize (self);
|
||||
g_clear_object (&parent_context);
|
||||
maybe_realize_context (self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user