-
Committer:
Dmitry Shachnev
-
Date:
2014-12-13 15:38:51 UTC
-
Revision ID:
mitya57@ubuntu.com-20141213153851-fw6mhzr747d5qpwa
Add AppMenuPlatformSystemTrayIcon implementation
Q: What’s this for?
A: Currently Qt 5 desktop applications which try to display a system
tray icon will fail to do so in Unity desktop, because we abandoned
the old XEmbed-based tray. This branch will make it work again, and
in a nicer way. As a side-effect, notifications will now work too.
Q: We already have sni-qt, why is this needed?
A: sni-qt was only working with Qt 4, it does not work with Qt 5.
Actually, a big part of code in this commit is copied from sni-qt.
Q: Why not just port sni-qt to Qt 5, why this code should be here?
A: In Qt 5, features such as platform tray icon should be implemented
using Qt Platform Abstraction (QPA), which was not the case in Qt 4.
More important, things like platform menu bar and platform tray icon
should be in the same plugin, called “platform theme”. There should be
only one platform theme for a platform, in Ubuntu it is appmenu-qt5.
Q: So is it just a copy of sni-qt code?
A: Most of it is based on sni-qt code, but it was changed a lot to work
with Qt 5 and QPA interface. I also cleaned it up a bit and deleted
some stuff that I think is not relevant.
Q: Does it add any additional dependencies to appmenu-qt5?
A: No. The only third-party library it needs is libdbusmenu-qt5, which
is already used by appmenu-qt5.
Q: How does it work?
A: There are two things we should export — the “status notifier item”
(which contains icon, tooltip, etc) and the menu. While the status
notifier item will work with any server-side implementation, the menu
will only work with ours (indicator-application). When
indicator-application sees that an item has a menu, it will convert
it into an indicator, and any indicator renderer (such as Unity, or
indicator-applet) will show it.
Q: Which desktop environments will it work with?
A: It is designed to work with anything that supports indicators, like
Unity or GNOME Flashback.
Q: Why the interface has KDE in name?
A: The StatusNotifierItem was originally developed by KDE project. While
it is very possible that this standard will be adopted by FreeDesktop,
indicator-application currently only supports the KDE name.
Q: Can KDE reuse this implementation?
A: They already have their own implementation, in Framework Integration.
I could not reuse their code because they have not signed the
Canonical contributor license agreement.