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

tray icon and menu icons are blank #43

Closed
totaam opened this issue Nov 15, 2011 · 49 comments
Closed

tray icon and menu icons are blank #43

totaam opened this issue Nov 15, 2011 · 49 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 15, 2011

Issue migrated from trac ticket # 43

component: client | priority: major | resolution: fixed

2011-11-15 16:45:35: Norman Rasmussen created the issue


Using: Ubuntu 10.04 Lucid

Even though it the logs show the icon_file is detected, the icon does not show in my tray notification area. There's a smallish (10px) blank space which I can click to get the menu.

None of the menu items have icons either, some have a no-entry style icon, which I think means bad image, or similar.

I'm happy to help debug, but I'm not sure where to start.

Log:

$ xpra attach -d all |& head -n 20
parse_shortcuts(['meta+shift+F4:quit'])
parse_shortcuts(['meta+shift+F4:quit'])={'F4': (['meta', 'shift'], 'quit')}
get_icon_filename(xpra.png)=/usr/share/xpra/icons/xpra.png, exists=True
set default window icon to /usr/share/xpra/icons/xpra.png
get_icon_filename(information.png)=/usr/share/xpra/icons/information.png, exists=True
get_icon_filename(configure.png)=/usr/share/xpra/icons/configure.png, exists=False
get_icon_filename(slider.png)=/usr/share/xpra/icons/slider.png, exists=True
get_icon_filename(keyboard.png)=/usr/share/xpra/icons/keyboard.png, exists=True
get_icon_filename(retry.png)=/usr/share/xpra/icons/retry.png, exists=True
get_icon_filename(quit.png)=/usr/share/xpra/icons/quit.png, exists=True
get_icon_filename(close.png)=/usr/share/xpra/icons/close.png, exists=True
get_tray_icon_filename using default: /usr/share/xpra/icons/xpra.png
write thread: waiting for data to write
read thread: waiting for data to arrive
'setxkbmap -query' failed with exit code 255
@totaam
Copy link
Collaborator Author

totaam commented Nov 15, 2011

2011-11-15 17:06:51: antoine changed status from new to accepted

@totaam
Copy link
Collaborator Author

totaam commented Nov 15, 2011

2011-11-15 17:06:51: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Nov 15, 2011

2011-11-15 17:09:56: antoine commented


oh great, another broken Ubuntu API to fix... I assume you are using "Unity", and I have experienced something similar with WinSwitch: IIRC the old API in 10.04 fails to use the absolute path we give it, and fails even further by not even placing some kind of placeholder icon there... sigh

@totaam
Copy link
Collaborator Author

totaam commented Nov 15, 2011

2011-11-15 17:45:55: Norman Rasmussen commented


Not using Unity yet, still Gnome v2, afaik. (I think Unity comes with Gnome v3?)

@totaam
Copy link
Collaborator Author

totaam commented Nov 15, 2011

2011-11-15 21:39:38: ddoole commented


I see this under KDE 4 as well. (kubuntu 11.04)

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2011

2011-11-16 04:52:33: antoine commented


Hah, it may well be that the code tries to use the new Ubuntu "indicator" API (re-inventing another wheel: tray icon under another name) since it is installed, but it may not be functional since you are not using the unity desktop... great, now I need to find a way to detect if the API actually works before using it.

@totaam
Copy link
Collaborator Author

totaam commented Nov 24, 2011

2011-11-24 11:40:48: pmarek commented


I'm on debian; winswitch shows icons in the tray and the menu, but xpra does not (apart from the ✓ beneath Bell etc.).

Hints for debugging appreciated.

@totaam
Copy link
Collaborator Author

totaam commented Nov 24, 2011

2011-11-24 17:55:58: totaam commented


Confirmed: as I expected it uses the appindicator API if it is present before trying to use the gtk.StatusIcon API, and since this re-invented wheel doesn't work properly (especially in Ubuntu 10.x)... You end up with the missing tray icon (this one is fixable) and missing menu entry icons (not fixable - this is a "feature").

I have also noticed that the encoding menu does not work, whereas the other menus more or less do - albeit without the icons.

Until I can figure out what to do with this horror, you can apply this patch to disable appindicator completely:

Index: xpra/xposix/gui.py
===================================================================
--- xpra/xposix/gui.py	(revision 296)
+++ xpra/xposix/gui.py	(working copy)
@@ -88,6 +88,7 @@
             return False
 
     def setup_appindicator(self, tray_icon_filename):
+        return False
         try:
             import appindicator            #@UnresolvedImport
             filename = self.get_tray_icon_filename(tray_icon_filename)

Next I will have to figure out in which case to use one API over the other... fun, not.

@totaam
Copy link
Collaborator Author

totaam commented Nov 24, 2011

2011-11-24 17:55:58: totaam

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2011

2011-11-25 21:35:38: totaam commented


These test results are absolutely shocking:

  • 10.04 + appindicator support is just plain awful: in gnome the tray icon is missing, the menu entries do not have any icons either, it does not work at all in lxde or xfce (not shown, no api errors either), shows up in KDE but the sub-menus are not working and it does not respond to left clicks!
  • 10.04 + statusicon works (tested in gnome, lxde, xfce and KDE)
  • 10.10 + appindicator and statusicon do not work anywhere!!? I can't see them/find them anywhere in gnome or lxde!
  • 11.04 + appindicator works but is missing the tray icon in lxde, also unusable in KDE: ugly, no-left click and the encoding submenu fills the whole screen!
  • 11.04 + statusicon works in unity and lxde, but is placed at the right edge of the screen in unity..
  • 11.10 + appindicator works
  • 11.10 + statusicon does not work: no api failure, nothing shown, nothing! (only works in xfce)

All other distros work just fine with statusicon, so really this is only an Ubuntu thing.


So, it looks like we will need to detect the desktop environment ("${DESKTOP_SESSION}") as well as the Ubuntu release ("lsb_release -a" ?) to decide on which api to use... How about debian?
Is there a better way to detect this brokenness?
IMNSHO: this sort of API breakage is a disgrace, re-inventing an existing API rather than extending it was a bad idea, but this level of incompetence beggars belief. Yes, you Ubuntu.


Some values collected:

  • DESKTOP_SESSION="kde"
  • DESKTOP_SESSION="ubuntu-2d"
  • DESKTOP_SESSION="LXDE"
  • 10.04:
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.3 LTS
Release:	10.04
Codename:	lucid
  • 10.10:
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
  • 11.04:
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 11.04
Release:	11.04
Codename:	natty
$ lsb_release -r
Release:	11.04
  • 11.10:
$ lsb_release -r
Release:	11.10
$ 

All Ubuntu versions tested had /etc/lsb-release... maybe this can be used to discriminate early?
etc..

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2011

2011-11-25 21:35:38: totaam

3 similar comments
@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2011

2011-11-25 21:35:38: totaam

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2011

2011-11-25 21:35:38: totaam

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2011

2011-11-25 21:35:38: totaam

@totaam
Copy link
Collaborator Author

totaam commented Nov 26, 2011

2011-11-26 11:40:22: totaam changed status from accepted to closed

@totaam
Copy link
Collaborator Author

totaam commented Nov 26, 2011

2011-11-26 11:40:22: totaam changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Nov 26, 2011

2011-11-26 11:40:22: totaam commented


r310 fixes this: we only enable the "appindicator" crap on Ubuntu 11.10 and later.

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 08:16:02: pmarek commented


Still doesn't work for me with 0.7.31 -- debian unstable, x86_64.

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 08:23:01: pmarek commented


I don't think this will help ...

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (wheezy)
Release:        testing
Codename:       wheezy

Perhaps this is better?

$ qdbus  org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetServerInformation
Plasma
KDE
1.0
1.1

Or just make it configurable which one to use ...

Putting return False in setup_appindicator doesn't help, either.

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 09:20:52: totaam uploaded file wheezy-gnome3.png (91.4 KiB)

wheezy + gnome3 showing the tray with icons
wheezy-gnome3.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 09:21:04: totaam uploaded file wheezy-kdeplasma.png (281.4 KiB)

wheezy + kde plasma
wheezy-kdeplasma.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 09:21:15: totaam uploaded file wheezy-lxde.png (152.8 KiB)

wheezy + lxde
wheezy-lxde.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 09:31:10: totaam uploaded file wheezy-xfce.png (165.1 KiB)

wheezy + xfce
wheezy-xfce.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2011

2011-11-29 09:32:52: totaam commented


As can be seen in the 4 screenshots above, a fresh default installation of wheezy works just fine with all desktop environments tested.

Maybe you have an old version of the package files still installed?
To allow me to reproduce, please create a brand new user and specify which desktop environment to use, and any other details that might be relevant.

btw, notifications and tray icons are different things, only loosely related

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 16:41:35: ddoole commented


I'm using r313 under kubuntu 11.04 and I am still not seeing tray icons.

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 18:11:12: totaam uploaded file natty-kdelogin.png (372.4 KiB)

kde plasma login
natty-kdelogin.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 18:12:00: totaam uploaded file natty-kdeplasma-xpratrayshown.png (241.2 KiB)

kdeplasma shows tray icon
natty-kdeplasma-xpratrayshown.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 18:17:49: totaam commented


I have just tried again with a brand new user created for the occasion, also tested both KDE/plasma and KDE/openbox session types.
The tray icon is there every time, and so are the icons in the tray menu.
Screenshots included.

If you want me to be able to fix this, you are going to have to give me steps to reproduce, as this is a brand new / clean install of Kubuntu 11.04 done for the occasion and it works just fine... I cannot fix something that I cannot see.
You should probably try with a new user first to rule out user settings, then do a clean install of Kubuntu in a virtual machine like I did to rule out installation problems.

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 18:45:04: ddoole commented


Ah, I figured out what's wrong - xpra is looking in the wrong place for the icons on my system.

I changed get_tray_icon_filename() to print the path being used, and it showed:

/opt/xpra/xpra-[r313](../commit/6dd1ff9dce7220c075d4f6ee534eda20fe3fc412)/install/lib/python/xpra/xposix/icons/xpra.png

which is odd because there is no icons directory under the xposix directory.

When I created a link from .../xposix/icons to /opt/xpra/share/xpra/icons and restarted the client, everything was working properly.

So, do I have my machine set up incorrectly? I extract everything to /opt/xpra/xpra-xxxx and build under that directory. For whatever build I am using, I link bin, share, and lib in /opt/xpra to /opt/xpra/xpra-xxxx/install. That is:

doole@andammo:/opt/xpra$ ls -l
lrwxrwxrwx  1 doole doole   21 2011-11-30 11:35 bin -> xpra-[r313](../commit/6dd1ff9dce7220c075d4f6ee534eda20fe3fc412)/install/bin
lrwxrwxrwx  1 doole doole   21 2011-11-30 11:35 lib -> xpra-[r313](../commit/6dd1ff9dce7220c075d4f6ee534eda20fe3fc412)/install/lib
lrwxrwxrwx  1 doole doole   23 2011-11-30 11:35 share -> xpra-[r313](../commit/6dd1ff9dce7220c075d4f6ee534eda20fe3fc412)/install/share
drwxr-xr-x 10 doole doole 4096 2011-11-03 14:58 xpra-0.0.7.30
drwxr-xr-x 10 doole doole 4096 2011-11-25 10:55 xpra-[r305](../commit/d3fac20753f08314f5e39dbe7dd8e9957021553c)
drwxr-xr-x 10 doole doole 4096 2011-11-30 11:35 xpra-[r313](../commit/6dd1ff9dce7220c075d4f6ee534eda20fe3fc412)

To run xpra, I do:

export PYTHONPATH=/opt/xpra/lib/python
/opt/xpra/bin/xpra

Is there something I should be doing differently?

@totaam
Copy link
Collaborator Author

totaam commented Nov 30, 2011

2011-11-30 20:47:37: ddoole commented


Ah, another insight. The path seems to be sensitive to whatever directory I issue the xpra command from. When I restarted the client just now, I was in my home directory and the reported icon path was /home/doole/icons/.

So it seems that, in my environment at least, xpra is looking in $PWD/icons.

@totaam
Copy link
Collaborator Author

totaam commented Dec 1, 2011

2011-12-01 07:14:07: totaam commented


I have no idea how/why you ended up using this sort of path for installation, please refer to the build instructions on this page and it should just work.

@totaam
Copy link
Collaborator Author

totaam commented Dec 1, 2011

2011-12-01 14:16:22: ddoole commented


I don't have root access on all the machines that I use, so I can't do the formal install.

I'm therefore compiling just for myself using the do-build script (as mentioned on that page). I don't want to have to change my PATH and PYTHONPATH every time I pull down a new version of xpra, so I link the bin, lib, and share directories into the /opt/xpra directory so I have a consistent location.

@totaam
Copy link
Collaborator Author

totaam commented Dec 1, 2011

2011-12-01 21:55:15: ddoole commented


Here's a change that worked for me. In xposix/gui.py, I changed get_data_dir() as follows:

Removed:

return os.getcwd()

Added:

# Otherwise assume we've got a local install (from do-build)
return os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../share/xpra"))

@totaam
Copy link
Collaborator Author

totaam commented Dec 2, 2011

2011-12-02 09:48:09: totaam commented


merged with a path test in r324 to avoid breaking other platforms: the win32 build in the installer relies on os.getcwd() to find the icons.

Thanks!

@totaam
Copy link
Collaborator Author

totaam commented Dec 2, 2011

2011-12-02 09:48:09: totaam

@totaam
Copy link
Collaborator Author

totaam commented Dec 2, 2011

2011-12-02 14:31:47: ddoole commented


r324 works for me. Thanks.

@totaam
Copy link
Collaborator Author

totaam commented Feb 20, 2012

2012-02-20 19:40:01: totaam

@totaam
Copy link
Collaborator Author

totaam commented Feb 26, 2012

2012-02-26 11:21:12: mgiammarco changed status from closed to reopened

@totaam
Copy link
Collaborator Author

totaam commented Feb 26, 2012

2012-02-26 11:21:12: mgiammarco changed resolution from fixed to **

@totaam
Copy link
Collaborator Author

totaam commented Feb 26, 2012

2012-02-26 11:21:12: mgiammarco commented


Are you sure that the bug is fixed? I have installed your ppa package into ubuntu unity 11.10, kubuntu 11.10, and an old ubuntu 10.04 (with gnome2) and I can see the icon only on the last one.

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 10:36:22: antoine commented


Just verified again in a virtual machine and both unity 11.10 and kubuntu worked fine. See screenshots.

Are you sure that the user you are running as is the same as your desktop session? (ie: not trying to run as root for example)
If not, you will get some warnings like these:

libappindicator-WARNING **: Unable to send signal for NewStatus: The connection is closed

When running with: xpra -d all attach ..., you can see near the top of the debug messages:

...
detected Ubuntu release [11, 10]
get_tray_icon_filename using default: /usr/bin/../share/xpra/icons/xpra.png
...

And this file exists and is installed by the packages.

If this does not help, please post the full command lines you are using and client debug log.

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 10:37:03: antoine uploaded file KDE-Ubuntu-11.10.png (52.4 KiB)

Ubuntu 11.10 + KDE showing the tray icon
KDE-Ubuntu-11.10.png

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 10:37:20: antoine uploaded file Unity-Ubuntu-11.10.png (108.6 KiB)

Ubuntu 11.10 + Unity showing the tray icon
Unity-Ubuntu-11.10.png

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 19:49:45: mgiammarco commented


Sorry I hope I have not make a mistake, but I am talking about winswitch_applet and not xpra. Am I right?

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 20:02:53: antoine changed status from reopened to closed

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 20:02:53: antoine changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 20:02:53: antoine commented


ahhhhhh, this is Xpra's bug tracker, winswitch's is here...

@totaam totaam closed this as completed Feb 27, 2012
@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2012

2012-02-27 20:05:56: antoine commented


New ticket: [https://winswitch.org/trac/ticket/193]

@totaam
Copy link
Collaborator Author

totaam commented Feb 21, 2019

2019-02-21 13:36:58: antoine commented


See also #406, #2161

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