summaryrefslogtreecommitdiff
path: root/gtk/gtkmodules.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-07-05 22:33:22 +0200
committerBenjamin Otte <otte@redhat.com>2011-07-06 16:50:09 +0200
commit768b192ddb3b77775def56ba755a667204b4b3e8 (patch)
tree8cb5d9b31b32b91a99ab769b45b5329ca0e93e7d /gtk/gtkmodules.c
parent4abbe4cb5226a3eb5fc168da16dc9be658573c80 (diff)
downloadgtk+-768b192ddb3b77775def56ba755a667204b4b3e8.tar.gz
modules: Blacklist gail
And print a message when somebody has it enabled that indicates that something is wrong but doesn't sound too scary.
Diffstat (limited to 'gtk/gtkmodules.c')
-rw-r--r--gtk/gtkmodules.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
index 5fa2abf8a1..57765256bb 100644
--- a/gtk/gtkmodules.c
+++ b/gtk/gtkmodules.c
@@ -258,6 +258,18 @@ cmp_module (GtkModuleInfo *info,
return info->module != module;
}
+static gboolean
+module_is_blacklisted (const gchar *name)
+{
+ if (g_str_equal (name, "gail"))
+ {
+ g_message ("Not loading module \"gail\": The functionality is provided by GTK natively. Please try to not load it.");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static GSList *
load_module (GSList *module_list,
const gchar *name)
@@ -289,7 +301,14 @@ load_module (GSList *module_list,
if (module)
{
- if (g_module_symbol (module, "gtk_module_init", &modinit_func_ptr))
+ /* Do the check this late so we only warn about existing modules,
+ * not old modules that are still in the modules path. */
+ if (module_is_blacklisted (name))
+ {
+ modinit_func = NULL;
+ success = TRUE;
+ }
+ else if (g_module_symbol (module, "gtk_module_init", &modinit_func_ptr))
modinit_func = modinit_func_ptr;
else
modinit_func = NULL;