/* Create a new window title string with user-defined title preference. (Or ignore it if unspecified).  */
gchar* create_user_window_title(const gchar *caption)
/* Create a new window title string with user-defined title preference. (Or ignore it if unspecified).  */
gchar* create_user_window_title(const gchar *caption)
{
    if (caption == NULL)
        return g_strdup("");
    if ((prefs.gui_window_title == NULL) || (*prefs.gui_window_title == '\0'))
        return g_strdup(caption);
    return g_strdup_printf("%s   [%s]", caption, prefs.gui_window_title);
}