Xpra: Ticket #1707: use the application icons for the systray icon

Split from #1701.

To make it easier to distinguish xpra sessions from each other, we could enumerate all the windows we have forwarded and combine their window icons into one.

If we don't have enough space to do this (ie: win32 systray can be quite small), maybe just show the first one on top of a stack.

Sun, 26 Nov 2017 16:48:44 GMT - Boruch:

The end result should not lose a clear indication that icon is for an instance of xpra, ie. so that the user doesn't confuse the icon for an application running in its native X environment.

Mon, 18 Dec 2017 06:56:04 GMT - Antoine Martin: status changed

Mostly done in r17673 (add overlay), r17674 (fixup reset icon code), r17691: use icon for tray.

The XPRA_ICON_OVERLAY env var controls what percentage of the icon we overlay with xpra's default icon (defaults to 50%). Whenever the list of windows changes, we figure out if all the icons are the same, and if they are then we use that one as tray icon instead of xpra's default icon.


Wed, 27 Dec 2017 11:08:43 GMT - Antoine Martin: owner, status changed

Minor changes:


@Boruch: does that work for you?

Wed, 03 Jan 2018 04:39:48 GMT - Boruch: attachment set

Wed, 03 Jan 2018 04:40:12 GMT - Boruch: owner changed

Using version r17795, The icons do work, and the XPRA_ICON_OVERLAY environment variable seems to be respected; however, the result for me isn't very visually noticeable. In the attached screenshot (a crop and zoom of the screenshot I posted for issue #1702), the first two icons were created with the default XPRA_ICON_OVERLAY setting, the third is an icon for an xpra instance running xclock, which may not have an icon of its own, and the fourth is an icon created with XPRA_ICON_OVERLAY set to 75. For me, the xpra contribution to the icon seems swallowed up by the other program's image.

Maybe, if its possible, define for xpra some percentage of the lower left of the icon space, and define for the program being run some percentage of the upper right of the icon space. With a setting of 65% for xpra and a setting of 50% for the other program, there would be an acceptable overlap, and my guess is that both images would remain clear. (IANAGD - I am not a graphic designer).

Wed, 03 Jan 2018 06:21:44 GMT - Antoine Martin: owner changed

Done in r17836, but still top-left to bottom-right, with defaults values (adjustable):

The result looks good to me, with only a slight overlap now, but this will need to be tested on more platforms, in particular win32 can have some very small tray icons which may cause problems with legibility. (and Ubuntu's Unity, macos... the usual problematic platforms)

Tue, 30 Jan 2018 16:22:50 GMT - Antoine Martin: owner changed

Minor improvements in r18189 + r18191: we don't overlay the xpra icon onto itself if we end up having to use the default icon for a window (ie: glxspheres).

@maxmylyn: FYI, feel free to just close.

Fri, 16 Feb 2018 21:29:39 GMT - J. Max Mena: status changed; resolution set

Noted and closing. Sorry for the long turnaround - been busy and reassigned to other things

Tue, 26 Jun 2018 07:44:03 GMT - Antoine Martin:

Fix in r19719: we reset the icon after one second to workaround tray geometry bugs (ie: gnome shell with topicons), but this was overwriting the dynamic icon with the default one.

Note: this feature can be disabled completely by setting: XPRA_DYNAMIC_TRAY_ICON=0.

Sat, 23 Jan 2021 05:31:37 GMT - migration script:

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