xpra icon
Bug tracker and wiki

Opened 8 years ago

Closed 7 years ago

Last modified 6 months ago

#43 closed defect (fixed)

tray icon and menu icons are blank

Reported by: Norman Rasmussen Owned by: Antoine Martin
Priority: major Milestone: 0.0.7.x
Component: client Version: 0.0.7.32
Keywords: Cc: mgiammarco@…

Description (last modified by Antoine Martin)

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

Attachments (8)

wheezy-gnome3.png (91.4 KB) - added by Antoine Martin 8 years ago.
wheezy + gnome3 showing the tray with icons
wheezy-kdeplasma.png (281.4 KB) - added by Antoine Martin 8 years ago.
wheezy + kde plasma
wheezy-lxde.png (152.8 KB) - added by Antoine Martin 8 years ago.
wheezy + lxde
wheezy-xfce.png (165.1 KB) - added by Antoine Martin 8 years ago.
wheezy + xfce
natty-kdelogin.png (372.4 KB) - added by Antoine Martin 8 years ago.
kde plasma login
natty-kdeplasma-xpratrayshown.png (241.2 KB) - added by Antoine Martin 8 years ago.
kdeplasma shows tray icon
KDE-Ubuntu-11.10.png (52.4 KB) - added by Antoine Martin 7 years ago.
Ubuntu 11.10 + KDE showing the tray icon
Unity-Ubuntu-11.10.png (108.6 KB) - added by Antoine Martin 7 years ago.
Ubuntu 11.10 + Unity showing the tray icon

Download all attachments as: .zip

Change History (36)

comment:1 Changed 8 years ago by Antoine Martin

Description: modified (diff)
Status: newaccepted

comment:2 Changed 8 years ago by Antoine Martin

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

comment:3 Changed 8 years ago by Norman Rasmussen

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

comment:4 Changed 8 years ago by Doug Doole

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

comment:5 Changed 8 years ago by Antoine Martin

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.

comment:6 Changed 8 years ago by pmarek

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.

comment:7 Changed 8 years ago by Antoine Martin

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.

Last edited 8 years ago by Antoine Martin (previous) (diff)

comment:8 Changed 8 years ago by Antoine Martin

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..

Last edited 8 years ago by Antoine Martin (previous) (diff)

comment:9 Changed 8 years ago by Antoine Martin

Resolution: fixed
Status: acceptedclosed

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

comment:10 Changed 8 years ago by pmarek

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

comment:11 Changed 8 years ago by pmarek

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.

Changed 8 years ago by Antoine Martin

Attachment: wheezy-gnome3.png added

wheezy + gnome3 showing the tray with icons

Changed 8 years ago by Antoine Martin

Attachment: wheezy-kdeplasma.png added

wheezy + kde plasma

Changed 8 years ago by Antoine Martin

Attachment: wheezy-lxde.png added

wheezy + lxde

Changed 8 years ago by Antoine Martin

Attachment: wheezy-xfce.png added

wheezy + xfce

comment:12 Changed 8 years ago by Antoine Martin

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

comment:13 Changed 8 years ago by Doug Doole

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

Changed 8 years ago by Antoine Martin

Attachment: natty-kdelogin.png added

kde plasma login

Changed 8 years ago by Antoine Martin

kdeplasma shows tray icon

comment:14 Changed 8 years ago by Antoine Martin

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.

comment:15 Changed 8 years ago by Doug Doole

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/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/install/bin
lrwxrwxrwx  1 doole doole   21 2011-11-30 11:35 lib -> xpra-r313/install/lib
lrwxrwxrwx  1 doole doole   23 2011-11-30 11:35 share -> xpra-r313/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
drwxr-xr-x 10 doole doole 4096 2011-11-30 11:35 xpra-r313

To run xpra, I do:

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

Is there something I should be doing differently?

comment:16 Changed 8 years ago by Doug Doole

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.

comment:17 Changed 8 years ago by Antoine Martin

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.

comment:18 Changed 8 years ago by Doug Doole

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.

comment:19 Changed 8 years ago by Doug Doole

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"))

comment:20 Changed 8 years ago by Antoine Martin

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!

Last edited 8 years ago by Antoine Martin (previous) (diff)

comment:21 Changed 8 years ago by Doug Doole

r324 works for me. Thanks.

comment:22 Changed 8 years ago by Antoine Martin

Milestone: 0.0.7.x
Version: 0.0.7.32

comment:23 Changed 7 years ago by mgiammarco

Cc: mgiammarco@… added
Resolution: fixed
Status: closedreopened

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.

comment:24 Changed 7 years ago by Antoine Martin

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.

Changed 7 years ago by Antoine Martin

Attachment: KDE-Ubuntu-11.10.png added

Ubuntu 11.10 + KDE showing the tray icon

Changed 7 years ago by Antoine Martin

Attachment: Unity-Ubuntu-11.10.png added

Ubuntu 11.10 + Unity showing the tray icon

comment:25 Changed 7 years ago by mgiammarco

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

comment:26 Changed 7 years ago by Antoine Martin

Resolution: fixed
Status: reopenedclosed

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

comment:27 Changed 7 years ago by Antoine Martin

comment:28 Changed 6 months ago by Antoine Martin

See also #406, #2161

Note: See TracTickets for help on using tickets.