summaryrefslogtreecommitdiff
path: root/gtk/gtkimmodule.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-03-09 02:13:13 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-03-09 02:13:13 -0500
commite0771a54a2102c80750beba2e643310118e98963 (patch)
tree458c279a4c24079d0fa7e50bd14f40f77c885542 /gtk/gtkimmodule.c
parent01fda3b85ee383637fb9d4befb1bfb7e5cae93b1 (diff)
downloadgtk+-e0771a54a2102c80750beba2e643310118e98963.tar.gz
Avoid warnings
When generating introspection data, we instantiate types without calling gtk_init, so make sure that extension points are registered before the type is trying to implement them.
Diffstat (limited to 'gtk/gtkimmodule.c')
-rw-r--r--gtk/gtkimmodule.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 5e45bd8cfb..0c99553423 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -237,12 +237,13 @@ _gtk_im_module_get_default_context_id (void)
}
void
-gtk_im_modules_init (void)
+gtk_im_module_ensure_extension_point (void)
{
GIOExtensionPoint *ep;
- GIOModuleScope *scope;
- char **paths;
- int i;
+ static gboolean registered = FALSE;
+
+ if (registered)
+ return;
GTK_NOTE (MODULES,
g_print ("Registering extension point %s\n", GTK_IM_MODULE_EXTENSION_POINT_NAME));
@@ -250,6 +251,18 @@ gtk_im_modules_init (void)
ep = g_io_extension_point_register (GTK_IM_MODULE_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (ep, GTK_TYPE_IM_CONTEXT);
+ registered = TRUE;
+}
+
+void
+gtk_im_modules_init (void)
+{
+ GIOModuleScope *scope;
+ char **paths;
+ int i;
+
+ gtk_im_module_ensure_extension_point ();
+
g_type_ensure (gtk_im_context_simple_get_type ());
#ifdef GDK_WINDOWING_X11
g_type_ensure (gtk_im_context_xim_get_type ());
@@ -282,8 +295,10 @@ gtk_im_modules_init (void)
if (GTK_DEBUG_CHECK (MODULES))
{
+ GIOExtensionPoint *ep;
GList *list, *l;
+ ep = g_io_extension_point_lookup (GTK_IM_MODULE_EXTENSION_POINT_NAME);
list = g_io_extension_point_get_extensions (ep);
for (l = list; l; l = l->next)
{