$OpenBSD: patch-libmenu_gmenu-tree_c,v 1.4 2011/09/26 10:47:35 jasper Exp $ Set default menu to gnome-applications.menu if XDG_MENU_PREFIX is not set. --- libmenu/gmenu-tree.c.orig Mon Aug 29 08:42:34 2011 +++ libmenu/gmenu-tree.c Mon Sep 26 11:19:16 2011 @@ -23,6 +23,7 @@ #include #include +#include #include "menu-layout.h" #include "menu-monitor.h" @@ -411,16 +412,13 @@ gmenu_tree_canonicalize_path (GMenuTree *tree, { menu_file = tree->basename; - if (strcmp (tree->basename, "applications.menu") == 0 && - g_getenv ("XDG_MENU_PREFIX")) - { - char *prefixed_basename; - prefixed_basename = g_strdup_printf ("%s%s", - g_getenv ("XDG_MENU_PREFIX"), - tree->basename); - canonicalize_basename (tree, prefixed_basename); - g_free (prefixed_basename); - } + setenv ("XDG_MENU_PREFIX", "gnome-", 0); + char *prefixed_basename; + prefixed_basename = g_strdup_printf ("%s%s", + g_getenv ("XDG_MENU_PREFIX"), + tree->basename); + canonicalize_basename (tree, prefixed_basename); + g_free (prefixed_basename); if (!tree->canonical) canonicalize_basename (tree, tree->basename); @@ -1875,18 +1873,15 @@ load_parent_merge_file (GMenuTree *tree, found = FALSE; menu_file = g_strconcat (menu_name, ".menu", NULL); - if (strcmp (menu_file, "applications.menu") == 0 && - g_getenv ("XDG_MENU_PREFIX")) - { - char *prefixed_basename; - prefixed_basename = g_strdup_printf ("%s%s", - g_getenv ("XDG_MENU_PREFIX"), - menu_file); - found = load_parent_merge_file_from_basename (tree, loaded_menu_files, - layout, prefixed_basename, - canonical_basedir); - g_free (prefixed_basename); - } + setenv ("XDG_MENU_PREFIX", "gnome-", 0); + char *prefixed_basename; + prefixed_basename = g_strdup_printf ("%s%s", + g_getenv ("XDG_MENU_PREFIX"), + menu_file); + found = load_parent_merge_file_from_basename (tree, loaded_menu_files, + layout, prefixed_basename, + canonical_basedir); + g_free (prefixed_basename); if (!found) {