mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
gdk: Ensure resources registration happens once
Like GTK does it. https://bugzilla.gnome.org/show_bug.cgi?id=765576
This commit is contained in:
parent
4fe336930e
commit
0e14456f15
18
gdk/gdk.c
18
gdk/gdk.c
@ -269,6 +269,22 @@ gdk_add_option_entries_libgtk_only (GOptionGroup *group)
|
|||||||
gdk_add_option_entries (group);
|
gdk_add_option_entries (group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gpointer
|
||||||
|
register_resources (gpointer dummy G_GNUC_UNUSED)
|
||||||
|
{
|
||||||
|
_gdk_register_resource ();
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_ensure_resources (void)
|
||||||
|
{
|
||||||
|
static GOnce register_resources_once = G_ONCE_INIT;
|
||||||
|
|
||||||
|
g_once (®ister_resources_once, register_resources, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_pre_parse (void)
|
gdk_pre_parse (void)
|
||||||
{
|
{
|
||||||
@ -277,7 +293,7 @@ gdk_pre_parse (void)
|
|||||||
|
|
||||||
gdk_initialized = TRUE;
|
gdk_initialized = TRUE;
|
||||||
|
|
||||||
_gdk_register_resource ();
|
gdk_ensure_resources ();
|
||||||
|
|
||||||
/* We set the fallback program class here, rather than lazily in
|
/* We set the fallback program class here, rather than lazily in
|
||||||
* gdk_get_program_class, since we don't want -name to override it.
|
* gdk_get_program_class, since we don't want -name to override it.
|
||||||
|
Loading…
Reference in New Issue
Block a user