Xpra: Ticket #448: cliboard handling breaks icon if using --tray-icon option

When you paste into an xpra session, the custom icon specified with the --tray-icon argument is replaced with the default xpra icon. It seems like this is a regression from #275.

I hacked a fix with the following diff by stumbling through the code (version 0.10.4+dfsg-2 in Debian jessie). Perhaps there is a more elegant way to do this?

1 jamie@animal:xpra$ diff -u client/ui_client_base.py{.orig,}
--- client/ui_client_base.py.orig 2013-10-23 17:48:24.260447362 -0400
+++ client/ui_client_base.py  2013-10-23 17:48:35.432433022 -0400
@@ -218,6 +218,7 @@
         if not opts.no_tray:
             self.menu_helper = self.make_tray_menu_helper()
             self.tray = self.setup_xpra_tray(opts.tray_icon)
+            self.tray.tray_icon_filename = tray_icon_filename
             if self.tray:
                 tray_icon_filename = self.tray.get_tray_icon_filename(tray_icon_filename)
                 if opts.delay_tray:
1 jamie@animal:xpra$ diff -u client/gtk2/client.py{.orig,}
--- client/gtk2/client.py.orig  2013-10-23 17:33:39.113595252 -0400
+++ client/gtk2/client.py 2013-10-23 17:49:35.884355482 -0400
@@ -200,7 +200,11 @@
             self.tray.set_tooltip("%s clipboard requests in progress" % n)
             self.tray.set_blinking(True)
         else:
-            self.tray.set_icon("xpra")
+            filename = self.tray.get_tray_icon_filename(self.tray.tray_icon_filename)
+            if filename:
+              self.tray.set_icon_from_file(filename)
+            else:
+              self.tray.set_icon("xpra")
             self.tray.set_tooltip("Xpra")
             self.tray.set_blinking(False)
1 jamie@animal:xpra$


Thu, 24 Oct 2013 13:22:51 GMT - Antoine Martin: owner, status changed; version, milestone set

Thanks for the report. This may well be the right fix, I'll have a look tomorrow (win32 and OSX make this more complicated than it should be!)


Tue, 29 Oct 2013 11:08:07 GMT - Antoine Martin: owner, status changed

Proper fix and much more in r4628.

This change is too big for the stable 0.10.x branch, so I think I will simply disable clipboard notifications via the tray and re-open #275 for testing instead.

Does that work ok for you?


Tue, 29 Oct 2013 13:19:18 GMT - jamie:

That sounds like the right way to go. Thanks for working through the proper fix.


Tue, 29 Oct 2013 13:21:10 GMT - jamie: owner changed

I'm re-assigning back to you. With these changes I consider the issue fixed. Not sure if you prefer to close now or close after the next release.


Tue, 29 Oct 2013 13:30:17 GMT - Antoine Martin: status changed; resolution set

Thanks, r4630 removes the tray icon change on clipboard notifications from v0.10.x and will be included in the next stable release.

Closing.


Sat, 23 Jan 2021 04:55:48 GMT - migration script:

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