1
Description: Support XDG_CURRENT_DESKTOP when looking at OnlyShowIn/NotShowIn
2
Origin: http://bugzilla-attachments.gnome.org/attachment.cgi?id=190706
3
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=653440
4
Bug-Ubuntu: https://launchpad.net/bugs/803519
6
Index: gnome-menus-3.0.1/libmenu/desktop-entries.c
7
===================================================================
8
--- gnome-menus-3.0.1.orig/libmenu/desktop-entries.c 2011-07-20 13:45:45.828954257 -0400
9
+++ gnome-menus-3.0.1/libmenu/desktop-entries.c 2011-07-20 13:46:02.096954430 -0400
14
+ const char *desktop;
17
no_display = g_key_file_get_boolean (key_file,
23
+ /* if the value is unset, fallback to GNOME, if the
24
+ * value is empty, allow all applications in the menu */
25
+ desktop = g_getenv ("XDG_CURRENT_DESKTOP");
26
+ if (G_LIKELY (desktop == NULL))
28
+ else if (*desktop == '\0')
29
+ goto skip_show_in_checks;
31
strv = g_key_file_get_string_list (key_file,
35
show_in_gnome = FALSE;
36
for (i = 0; strv[i]; i++)
38
- if (!strcmp (strv[i], "GNOME"))
39
+ if (!strcmp (strv[i], desktop))
45
for (i = 0; strv[i]; i++)
47
- if (!strcmp (strv[i], "GNOME"))
48
+ if (!strcmp (strv[i], desktop))
50
show_in_gnome = FALSE;
56
+ skip_show_in_checks:
58
tryexec_failed = FALSE;
59
tryexec = g_key_file_get_string (key_file,