Add support for loading gtk3-only modules

Introduce GTK3_MODULES environment variable for modules that don't work
in gtk3. The list of modules is now $GTK3_MODULES:$GTK_MODULES.

https://bugzilla.gnome.org/show_bug.cgi?id=743917
This commit is contained in:
Lars Uebernickel 2015-02-03 11:01:29 +01:00
parent 2820c342f6
commit 3e81653bd3
2 changed files with 24 additions and 3 deletions

View File

@ -36,7 +36,7 @@ some additional commandline options.
<para>
A list of modules to load in addition to those specified in the
<envar>GTK_MODULES</envar> environment variable and the
<envar>GTK3_MODULES</envar> environment variable and the
<literal>gtk-modules</literal> setting.
</para>
</formalpara>
@ -223,14 +223,24 @@ additional environment variables.
</formalpara>
<formalpara>
<title><envar>GTK_MODULES</envar></title>
<title><envar>GTK3_MODULES</envar></title>
<para>
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
</para>
</formalpara>
<formalpara>
<title><envar>GTK_MODULES</envar></title>
<para>
A list of modules to load in addition to the ones in the <envar>GTK3_MODULES</envar> variable.
</para>
<warning>
Note that this environment variable is read by GTK+ 2.x too,
which may not have the same set of modules available for loading.
Use <envar>GTK3_MODULES</envar> for modules that are only compatible
with GTK+ 3.
</warning>
</formalpara>

View File

@ -657,9 +657,20 @@ do_pre_parse_initialization (int *argc,
}
#endif /* G_ENABLE_DEBUG */
env_string = g_getenv ("GTK_MODULES");
env_string = g_getenv ("GTK3_MODULES");
if (env_string)
gtk_modules_string = g_string_new (env_string);
env_string = g_getenv ("GTK_MODULES");
if (env_string)
{
if (gtk_modules_string)
g_string_append_c (gtk_modules_string, G_SEARCHPATH_SEPARATOR);
else
gtk_modules_string = g_string_new (NULL);
g_string_append (gtk_modules_string, env_string);
}
}
static void