5

I built wxWidgets 2.9.3 (for the moment I must stick to this version) under Ubuntu 12.10 and I can't seem to use wxTaskBarIcon class. The sample which is delivered with wxWidgets is compiling and running, but the icon itself is not showing on the taskbar itself. I checked my config, and I know, that compilation of wxWidgets libraries were executed with default setting (which is "yes" for taskbar support).

Any idea how to make it working? Is this problem related with wxWidgets and/or Ubuntu version?

Edit: It is definitely not connected to the wxWidgets version (checked under wx 2.8, 2.9.3, 2.9.4).

Edit 2: In case it matters: System is on VirtualBox 4.2.6, installed with the all default settings. I am installing updates at least once a week.

Rivenris
  • 91
  • 1
  • 8
  • Maybe you could make a [SSCCE](http://sscce.org/) to show us what you've done? – Some programmer dude Jan 25 '13 at 11:38
  • Which Window Manager are you using? There are a lot of caveats mentioned right at the top of http://docs.wxwidgets.org/2.8/wx_wxtaskbaricon.html – ta.speot.is Jan 25 '13 at 11:56
  • @JoachimPileborg I could post my code example, but it may be unnecessary as the default sample doesn't work either. – Rivenris Jan 26 '13 at 08:12
  • @ta.speot.is I am using default one in Ubuntu 12.10 (which is Gnome 3.6.0). – Rivenris Jan 26 '13 at 08:19
  • I suppose you could rule out the caveats I linked to, it [seems like `wxTaskBarIcon` works (at least nominally) on Gnome 3.6](http://guayadeque.org/index.php?p=/discussion/758/change-indicatortray-icon/p1) – ta.speot.is Jan 26 '13 at 08:44
  • I did test it on wx2.8 and wx2.9.4. Those examples didn't work either. It must be somehow connected to the Gnome, although I have no idea where to look for causes now. If there was some kind of error during execution I'd get appropriate message box. But I don't, so I assume api functions are executed successfully under the hood. – Rivenris Jan 26 '13 at 12:01

1 Answers1

3

Under Ubuntu since 11.04 taskbar is managed by Unity which by default doesn't allow all programs to put their icons there. You must whitelist your application to let it access taskbar. Here is where I found the answer originally:

http://ubuntuforums.org/showthread.php?t=1737589

Basically you must call:

gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Mumble', 'Wine', 'Skype', 'YOUR_APPLICATION']"

Then log out, log in. This will add YOUR_APPLICATION to the Unity.Panel whitelist. Bear in mind that in this case you must also list items which were on that list beforehand. You can check how whitelist looks by calling:

gsettings get com.canonical.Unity.Panel systray-whitelist

In my case (as I am working on development environment) I just set it to "['all']". This will allow all applications to access taskbar.

Bear in mind that Ubuntu will be dropping such support and in the future you should use AppIndicator library instead to achieve that goal. This means, that wxTaskBarIcon won't be working even with whitelist unless it'll be using AppIndicator library.

Source: http://www.webupd8.org/2013/02/unity-notification-area-systray.html

halfer
  • 19,824
  • 17
  • 99
  • 186
Rivenris
  • 91
  • 1
  • 8
  • 1
    Is there a reason why wxWidgets is lagging behind? Surely `wxTaskBarIcon` should get an `Appindicator` implementation – fatuhoku Nov 05 '13 at 16:20
  • I can only guess that this is connected with fact, that wxWidgets is rather GTK-oriented, not Ubuntu. It may be difficult to adjust `wxTaskBarIcon` to Ubuntu, especially when `AppIndicator` has way less possibilities than gtk icon (events on show, etc). Also in my experience `AppIndicator` is less reliable as I found a lot of bugs and strange behavior there. – Rivenris Nov 06 '13 at 17:14