Bug 1353249
| Summary: | gnome-shell-extension-apps-menu will crash when alternate AppDirs are defined in /etc/xdg/menus/applications-merged | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jonathan Billings <jsbillin> |
| Component: | gnome-shell-extensions | Assignee: | Florian Müllner <fmuellner> |
| Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | mboisver, mclasen, tpelka |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-04 01:44:53 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jonathan Billings
2016-07-06 15:56:29 UTC
(In reply to Jonathan Billings from comment #0) > What is happening is that appSys.lookup_app() is returning null, and JS just > stops and logs the above error. I made a minor modification to the > extension.js file so it looks like this: > > 424 let app = > appSys.lookup_app(entry.get_desktop_file_id()); > 425 if (app == null) { > 426 global.log("null app: "+ > entry.get_desktop_file_id()) > 427 } else if (appInfo.should_show()) { > 428 let menu_id = dir.get_menu_id(); > 429 > this.applicationsByCategory[categoryId].push(app); > 430 } > > [...] > Now the Application menu doesn't generate any errors in the logs, but of > course, my menus don't appear. I was going to file a bug against the > upstream Gnome project, but I ran across this bug in their BZ: > https://bugzilla.gnome.org/show_bug.cgi?id=762206 > > This makes me think that the Gnome3 developers don't intend to support > alternate AppDirs. Right. The reasoning is that no other component that deals with applications handles .desktop files in non-standard locations ("Open With" in the file manager, default applications in Settings, pinning apps as favorite to gnome-shell's dash, ...), and we don't want all those components do the complex processing of the menu definitions. Those applications won't show up gnome-shell's "normal" application list (i.e. the one in the overview, not the application menu in gnome-classic). So the only fix we will consider upstream is to handle the case where the lookup failed and ignore the entry (as your modification, but without the logging). I would be fine with supporting this case downstream though - it only requires a minor modification in gnome-shell and the extension. However ... > In the end, I made a symlink /usr/local/share/applications to point at our > alternative AppDir, since we weren't using /usr/local/share/applications > already, but this is obviously a limited solution, it breaks the > 'filesystem' package's RPM validation check: > > # rpm -V filesystem > .....UG.. /usr/local/share/applications > > So we have to manage that symlink externally to RPM now. ... have you considered adding /usr/caen/misc/menus to XDG_DATA_DIRS? This should be possible by installing a snippet like export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr:/usr/local}:/usr/caen/misc/menus in /etc/profile.d/caen.sh or similar. With this change, the applications would not only show up in the application menu, but also work in all the cases mentioned above. Using $XDG_DATA_DIRS is a good solution, although the appropriate definition would be:
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share:/usr/local/share}:/usr/caen/misc/menus
... and in my case, I put it in /etc/X11/xinit/xinitrc.d/99-caenapps.sh, since it really only makes sense to evaluate it during graphical login.
I believe that the issue of an undefined 'app' variable has been fixed in newer versions of the extension, and I'm sure it's a lot better handled than my crude fix.
(In reply to Jonathan Billings from comment #3) > Using $XDG_DATA_DIRS is a good solution, although the appropriate definition > would be: > > export > XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share:/usr/local/share}:/usr/caen/misc/ > menus Ah yes, sorry for the slip. > I believe that the issue of an undefined 'app' variable has been fixed in > newer versions of the extension No, it's still present on master. As mentioned in the previous comment, I don't think we want anything besides if (!app) continue; upstream, but I'm up to adding downstream patches to make those apps show up properly in the menu, if that's still wanted. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2258.html |