Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the application icons for the systray icon #1707

Closed
totaam opened this issue Nov 26, 2017 · 9 comments
Closed

use the application icons for the systray icon #1707

totaam opened this issue Nov 26, 2017 · 9 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 26, 2017

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.

@totaam
Copy link
Collaborator Author

totaam commented Nov 26, 2017

2017-11-26 16:48:44: Boruch commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Dec 18, 2017

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.

Caveats:

  • not tested on Ubuntu Unity, KDE or macos
  • tray icon is disabled on win32 (looks garbled, loses the "visibility" settings - not sure the latter is fixable)

@totaam
Copy link
Collaborator Author

totaam commented Dec 27, 2017

Minor changes:

  • r17763: impossible to enable on macos (the dock icon cannot be changed once set)
  • r17765: fix MS Windows systray code and enable it there

Recap:

  • pagers and window decoration icons should now be using a composite icon with the xpra logo overlaid in the bottom right corner
  • the systray icon will use the same composite icon as long as there is only one window, or if all the windows use the same icon - otherwise the default "xpra" icon will be used

@boruch: does that work for you?

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2018

2018-01-03 04:39:48: Boruch uploaded file xpra_icons_3.png (8.2 KiB)

xpra_icons_3.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2018

2018-01-03 04:40:13: Boruch commented


Using version 17795, 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).

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2018

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

  • XPRA_ICON_SHRINKAGE=75 - shrink the application icon to 75% of its original size
  • XPRA_ICON_OVERLAY=50 - shrink xpra icon to 50%

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)

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2018

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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 16, 2018

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

@totaam totaam closed this as completed Feb 16, 2018
@totaam
Copy link
Collaborator Author

totaam commented Jun 26, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant