Advanced topics

This section provides a short introduction to some of the advanced topics in the Thunar Extension Framework.

Memory-Resident Extensions

Some extensions may not play well with Thunar's on-demand loading and unloading of extensions. For example, an extension that uses a desktop library, which in turn registers additional static GTypes will not work after being loaded and unloaded for the first time. For these kind of extensions, Thunar provides the option to make extensions memory resident, which means the extension will be loaded once and afterwards will never be unloaded again until Thunar exits.

Such extensions must set the resident property of the type module in its thunar_extension_initialize() function to TRUE.

Example 2. Making an extension memory resident

G_MODULE_EXPORT void
thunar_extension_initialize (GTypeModule *module)
{
  /* setup the types for the extension */
  ...

  /* ensure that the extension will never be unloaded */
  g_object_set (G_OBJECT (module),
                "resident", TRUE,
                NULL);
}