We can use python-xdg Menu to get the list of .desktop applications. And inotify to watch for changes. Then if the client supports it, we send the list of commands - and maybe inline a small version of the icon?
Then the start-command dialog can offer a menu.
(on mswindows, we could use Programmatically access All Users Start Menu, macos: not sure)
Done in r20699.
CellRendererPixbuf, ie: http://python.zirael.org/e-gtk-combobox1.html
Really like this feature but think it could be more accessible from the main tray menu. What do you think?
Forgive my horrible Python coding but a quick example is here: https://github.com/mjharkin/Xpra/commit/63daf5a7e48f704bf0e8df0462c3d7fcad7b0f02
@mjharkin: is that good enough? I've renamed the menu entry to "start" amongst other changes.
I think start.png is missing from the r20813 commit. I've the same issue with category icons. Otherwise looks great. Thanks.
The only other change I would like to get in this release is the move to a separate "xdg-data" packet.
r20846 avoid errors with win32 clients: convert xpm icons to png server-side before sending.
code made more resilient in r20850: found some xpm icons that pillow could not load, we now log a warning and continue without.
With the changes for xpm load failure handling r20850, if the icon fails to load there is no menu item created. Could this be changed to load with a default icon or no icon?
mjharkin: try r20882, which should also fix the icon loading for tricky 'xpm' files: we now try loading with GTK first, and fallback to Pillow only if that fails. (and failures won't fail the whole desktop entry)
Looks good. Icons load correctly now.
XDG commands can also include %f %F %u %U placeholders. (https://portland.freedesktop.org/xdg-utils-1.1.0-rc1/scripts/html/xdg-desktop-menu.html)
I think it's best to remove them on the client side, incase we want to use them later on.
Something like this should fix the issue for now:
import re ... command = re.sub('\%[fFuU]', '', command)
mjharkin: thanks, applied in r20913. Yes, those could eventually be used to support "open with xyz on server".
Packaging fix for win32 in r20966.
Some SVG icons must have text in them, because the win32 builds moan about fonts:
(Xpra:4056): Pango-WARNING **: couldn't load font "Bitstream Vera Sans Not-Rotated 11.7294921875", \ falling back to "Sans Not-Rotated 11.7294921875", expect ugly output.
Avoid SVG? Convert to bitmap icons on the fly? Find a way to silence the warning? Just ignore it?
Some relevant info: Pango unable to find fonts with librsvg
Let's ignore the warning since we can't silence it: gobject-introspection: g_log_set_handler is not available
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1961