Xpra: Ticket #1961: easier start-command: expose applications

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)

Sun, 23 Sep 2018 05:22:24 GMT - Antoine Martin: status, milestone changed

Thu, 18 Oct 2018 09:04:35 GMT - Antoine Martin:

Done in r20699.

Still TODO:

Mon, 22 Oct 2018 18:57:59 GMT - Mark Harkin:

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

Wed, 24 Oct 2018 12:01:04 GMT - Antoine Martin: owner, status changed


@mjharkin: is that good enough? I've renamed the menu entry to "start" amongst other changes.

Still TODO:

Thu, 25 Oct 2018 08:13:16 GMT - Mark Harkin:

I think start.png is missing from the r20813 commit. I've the same issue with category icons. Otherwise looks great. Thanks.

Thu, 25 Oct 2018 09:16:09 GMT - Antoine Martin: owner, status changed

The only other change I would like to get in this release is the move to a separate "xdg-data" packet.

Sun, 28 Oct 2018 06:37:55 GMT - Antoine Martin:

r20846 avoid errors with win32 clients: convert xpm icons to png server-side before sending.

Sun, 28 Oct 2018 10:13:20 GMT - Antoine Martin:

code made more resilient in r20850: found some xpm icons that pillow could not load, we now log a warning and continue without.

Sun, 28 Oct 2018 12:07:00 GMT - Antoine Martin:

Tue, 30 Oct 2018 12:07:33 GMT - Mark Harkin:

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?


Tue, 30 Oct 2018 12:40:18 GMT - Antoine Martin:

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)

Tue, 30 Oct 2018 13:12:59 GMT - Mark Harkin:

Looks good. Icons load correctly now.


Fri, 02 Nov 2018 13:12:50 GMT - Mark Harkin:

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:

In gtk_tray_menu_base.py->make_applaunch_menu_item()

import re
command = re.sub('\%[fFuU]', '', command)

Fri, 02 Nov 2018 14:51:15 GMT - Antoine Martin:

mjharkin: thanks, applied in r20913. Yes, those could eventually be used to support "open with xyz on server".

Mon, 05 Nov 2018 15:05:54 GMT - Antoine Martin: status changed; resolution set

Packaging fix for win32 in r20966.

Tue, 13 Nov 2018 16:51:43 GMT - totaamwin32: status changed; resolution deleted

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

Sat, 24 Nov 2018 10:01:21 GMT - Antoine Martin: status changed; resolution set

Let's ignore the warning since we can't silence it: gobject-introspection: g_log_set_handler is not available

Sat, 23 Jan 2021 05:38:26 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1961