Our gnome-session already exports XDG_MENU_PREFIX in the environment, so

no need to play with get/setenv.
gnome-panel is not supposed to be started by anything than gnome-session
anyway and it will ease future updates.
This commit is contained in:
ajacoutot 2011-12-28 08:56:57 +00:00
parent 903b5233a6
commit 29bc074c65
4 changed files with 2 additions and 76 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.108 2011/12/03 22:17:16 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.109 2011/12/28 08:56:57 ajacoutot Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= GNOME panel
GNOME_PROJECT= gnome-panel
GNOME_VERSION= 3.2.1
REVISION= 3
REVISION= 4
SHARED_LIBS= panel-applet-4 1.0 # 0.0

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-gnome-panel_menu_c,v 1.7 2011/09/26 11:14:36 jasper Exp $
--- gnome-panel/menu.c.orig Mon Aug 1 19:39:56 2011
+++ gnome-panel/menu.c Mon Sep 26 12:53:17 2011
@@ -25,6 +25,7 @@
#include "menu.h"
#include <string.h>
+#include <stdlib.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -1400,8 +1401,16 @@ GtkWidget *
create_main_menu (PanelWidget *panel)
{
GtkWidget *main_menu;
+ gchar *xdgMenuPrefix, *applicationsMenu;
- main_menu = create_applications_menu ("applications.menu", NULL, TRUE);
+ /* Respect XDG_MENU_PREFIX */
+ setenv ("XDG_MENU_PREFIX", "gnome-", 0);
+
+ xdgMenuPrefix = getenv ("XDG_MENU_PREFIX");
+ applicationsMenu = g_strconcat (xdgMenuPrefix, "applications.menu", NULL);
+
+ main_menu = create_applications_menu (applicationsMenu, NULL, TRUE);
+ g_free (applicationsMenu);
g_object_set_data (G_OBJECT (main_menu), "menu_panel", panel);
/* FIXME need to update the panel on parent_set */

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-gnome-panel_panel-menu-bar_c,v 1.2 2011/09/12 07:28:54 jasper Exp $
--- gnome-panel/panel-menu-bar.c.orig Wed May 18 11:12:53 2011
+++ gnome-panel/panel-menu-bar.c Wed May 18 11:14:30 2011
@@ -29,6 +29,7 @@
#include "panel-menu-bar.h"
#include <string.h>
+#include <stdlib.h>
#include <glib/gi18n.h>
#include <libpanel-util/panel-error.h>
@@ -125,11 +126,20 @@ panel_menu_bar_setup_tooltip (PanelMenuBar *menubar)
static void
panel_menu_bar_init (PanelMenuBar *menubar)
{
+ gchar *xdgMenuPrefix, *applicationsMenu;
+
menubar->priv = PANEL_MENU_BAR_GET_PRIVATE (menubar);
menubar->priv->info = NULL;
- menubar->priv->applications_menu = create_applications_menu ("applications.menu", NULL, TRUE);
+ /* Respect XDG_MENU_PREFIX */
+ setenv ("XDG_MENU_PREFIX", "gnome-", 0);
+
+ xdgMenuPrefix = getenv ("XDG_MENU_PREFIX");
+ applicationsMenu = g_strconcat (xdgMenuPrefix, "applications.menu", NULL);
+
+ menubar->priv->applications_menu = create_applications_menu (applicationsMenu, NULL, TRUE);
+ g_free (applicationsMenu);
menubar->priv->applications_item = panel_image_menu_item_new ();
gtk_menu_item_set_label (GTK_MENU_ITEM (menubar->priv->applications_item),

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-gnome-panel_panel-menu-button_c,v 1.2 2011/09/12 07:28:54 jasper Exp $
--- gnome-panel/panel-menu-button.c.orig Wed May 18 11:08:41 2011
+++ gnome-panel/panel-menu-button.c Wed May 18 11:09:10 2011
@@ -74,7 +74,7 @@ typedef struct {
} MenuPathRootItem;
static MenuPathRootItem root_items [] = {
- { APPLICATIONS_MENU, "applications", "applications.menu" },
+ { APPLICATIONS_MENU, "applications", "gnome-applications.menu" },
{ GNOMECC_MENU, "gnomecc", "gnomecc.menu" }
};