GNOME Bugzilla – Bug 759004
Missing entries in applications menu
Last modified: 2016-03-03 16:48:33 UTC
Certain groups in the Applications menu do not get any entries such as Programming, Graphics and Office. This is despite enabling entries using alacarte. On hovering over one of the empty groups in the menu with the mouse cursor the following items, and more, appear in syslog Dec 3 23:25:42 quad gnome-session[4856]: (gnome-shell:5021): Gjs-WARNING **: JS ERROR: TypeError: b is null Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications/<@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:573 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:572 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<.selectCategory@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:548 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<.setActive@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:203 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: PopupBaseMenuItem<._onHoverChanged@resource:///org/gnome/shell/ui/popupMenu.js:160 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: (gnome-shell:5021): Gjs-WARNING **: JS ERROR: TypeError: b is null Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications/<@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:573 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:572 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<.selectCategory@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:548 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<.setActive@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:203 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: PopupBaseMenuItem<._onHoverChanged@resource:///org/gnome/shell/ui/popupMenu.js:160 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<._onMotionEvent@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:184 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: (gnome-shell:5021): Gjs-WARNING **: JS ERROR: TypeError: b is null Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications/<@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:573 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:572 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<.selectCategory@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:548 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<.setActive@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:203 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: PopupBaseMenuItem<._onHoverChanged@resource:///org/gnome/shell/ui/popupMenu.js:160 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<._onMotionEvent@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:184 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: (gnome-shell:5021): Gjs-WARNING **: JS ERROR: TypeError: b is null Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications/<@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:573 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<._listApplications@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:572 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: ApplicationsButton<.selectCategory@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:548 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: CategoryMenuItem<.setActive@/usr/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/extension.js:203 Dec 3 23:25:42 quad gnome-session[4856]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 Dec 3 23:25:42 quad gnome-session[4856]: PopupBaseMenuItem<._onHoverChanged@resource:///org/gnome/shell/ui/popupMenu.js:160
I and others are having this issue, it's not isolated. For me it has happened in both Arch and Fedora, I've had to switch to frippery applications menu till this issue gets resolved
Created attachment 317521 [details] log info
Created attachment 317522 [details] [review] apps-menu: Debug failed app lookup Can you provide a log with this patch applied? For some reason there are .desktop entries in the menu that we cannot resolve to an application ...
If you could tell me how to get the info you need I'd be more than happy to provide it. I'm still pretty new to Linux, I'm currently using Arch if that matters. I hope the chunk of log I'm about to attach helps, but I'm not sure if it's what you need or not. It actually goes on for quite a lot of lines more than I'm attaching.
Created attachment 317526 [details] I used journalctl -rx > /location/of/filename to get this info If other info is needed please advise and I will provide
(In reply to Joseph Bodhorn from comment #5) > Created attachment 317526 [details] Are you sure you applied the patch? I don't see the added log message, and it's the only place where we should be able to add a null entry ... (If you don't have the sources to apply the patch, it may be easier to edit the installed extension.js file directly)
Created attachment 317529 [details] Log from patch applied I added the patch to my installed file and could not get any change in the log messages until I restarted gnome shell. I then found these messages in the syslog.
Created attachment 317530 [details] .desktop file that is mentioned first in previous log Here is the first .desktop file mentioned in the above log.
Just for the record $ which scangui /usr/bin/scangui
Created attachment 317532 [details] edited extension.js Terribly sorry, I had just skimmed your reply on my phone and missed that I was supposed to patch the extension before posting the log. I hope I did the patch right, I've only had to patch one in the past. Once again I output journalctl -rx to a file, if I need to obtain the log info a different way please advise. The log is huge, I cut what I thought is needed and attached that, but here's a pastebin from this session till the file output http://pastebin.com/fuZDEXfe
(In reply to Joseph Bodhorn from comment #10) > Terribly sorry, I had just skimmed your reply on my phone and missed that I > was supposed to patch the extension before posting the log. No worries, we already got a log in comment #8 that shows the problem.
Created attachment 317534 [details] [review] apps-menu: Remove unused variable
Created attachment 317535 [details] [review] apps-menu: Fix .desktop entries in subdirectories GMenu's TreeEntries return an AppInfo that is created from the .desktop filename, not from a desktop ID as expected by the AppSystem. As a result, g_app_info_get_id() will simply return the file's basename, which only matches the desktop ID if no prefix-to-subdirectory mapping as described in the menu spec is involved. Fix this by basing the app lookup on the entry's desktop ID instead of the AppInfo.
Works for me. Thank you Florian.
Attachment 317534 [details] pushed as 1958ce7 - apps-menu: Remove unused variable Attachment 317535 [details] pushed as 79c76a8 - apps-menu: Fix .desktop entries in subdirectories
(In reply to Florian Müllner from comment #15) > Attachment 317534 [details] pushed as 1958ce7 - apps-menu: Remove unused > variable > Attachment 317535 [details] pushed as 79c76a8 - apps-menu: Fix .desktop > entries in subdirectories Thank you much
*** Bug 759879 has been marked as a duplicate of this bug. ***
*** Bug 759994 has been marked as a duplicate of this bug. ***
*** Bug 760333 has been marked as a duplicate of this bug. ***
Attachment 317535 [details] causes apps-menu stop working when app is null. Error message found in journal: gnome-shell-wayland.desktop[6887]: Gjs-Message: JS LOG: Extension "apps-menu@gnome-shell-extensions.gcampax.github.com" had error: TypeError: app is null This problem is caused by the file /usr/share/applnk/google-chrome.desktop on my system. entry.get_desktop_file_id() returns 'kde-google-chrome.desktop', and appSys.lookup_app() cannot find it. Should we have a null check here to prevent the problem?
(In reply to Ting-Wei Lan from comment #20) > Should we have a null check here to prevent the problem? Either that, or remove those legacy dirs from gnome-menus - those directories have been deprecated for over a decade now. I filed a patch in bug 760900, let's see how it goes.
I think the patch in bug 760900 will work with GNOME 3.20, but we still need a solution for GNOME 3.18.
not a 3.20 blocker anymore, then
The following fix has been pushed: 2383462 apps-menu: Catch menu tree entries we can't resolve to an app
Created attachment 323008 [details] [review] apps-menu: Catch menu tree entries we can't resolve to an app The default .menu file still contains a number of legacy directories that have been deprecated for over 15 years, which GIO (and in extension the shell's AppSystem) ignore. Encountering such an entry currently triggers an exception and an entire category ends up empty, fix this by silently skipping over the offending entry.