Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

c++ - wxTaskBarIcon in Ubuntu 12.10

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...