|Summary:||xdg-desktop-menu does not treat folders with spaces correctly|
|Product:||Portland||Reporter:||Antti Savolainen <antti.savo>|
|Component:||xdg-utils||Assignee:||Portland Bugs <portland-bugs>|
|Status:||RESOLVED MOVED||QA Contact:|
|i915 platform:||i915 features:|
|Attachments:||contents of ~./.config/menus|
Description Antti Savolainen 2017-10-19 19:59:51 UTC
Created attachment 134927 [details] contents of ~./.config/menus When editing wine program locations with menulibre the result often just breaks down with folders disappearing completely or some other weird glitch happening. For example: If files in application-merged are removed so that they can be recreated, the files reappear after you move the .desktop files back to their folders with menulibre. If the folders contain spaces, it considers all spaces to be a separator for a sub-folder which can cause glitching (seen here https://i.imgur.com/JKOh4fF.png). Example file /menus/applications-merged/user-wine-wine-wine-Programs-League-of-Legends.menu in attachments Steps to produce: Install a program with spaces with wine Delete the .menu file from applications-merged Open menulibre and move the .desktop back to where it was What happens applications-merged should now contain a bugged file I'm not sure how the folders disappearing works when you move the files around with menulibre without deleting anything from applications-merged.
Comment 1 Hans Petter Jansson 2017-11-05 20:40:43 UTC
Thanks for reporting this. It looks like a bug in xdg-desktop-menu, which is a part of xdg-utils. It's a shell script, and from the looks of it it's not built to deal with filenames with spaces in them, e.g. it does this: > for desktop_file in $directory_files; do ... done ...which breaks down when $directory_files expands to a list of names with spaces in them. There are ways to deal with this in shell scripts, but none of them are very pleasant (I suggest setting IFS='\n\t' and using arrays, but you have to make sure it works with bash, dash and maybe other shells). As an a propos, I have correctly installed Wine menu files in ~/.config/menus/applications-merged/ with spaces in the directory names -- but I'm not sure what installed those. I'm reassigning this bug to the appropriate product (which unfortunately is not that easy to locate).
Comment 2 Antti Savolainen 2017-11-09 13:34:35 UTC
I did a fresh install recently and noticed that after installing wine and a program with it that the menus folder doesn't have a symlink gnome-applications-merged or xfce-applications.menu at all. It only has applications-merged and a single .menu file for each of the .desktop files that you want to add to the menu. Possibly the reason why I was seeing duplicates in the whiskers menu.
Comment 3 GitLab Migration User 2019-02-16 13:39:31 UTC
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/117.