linuxmint / xapp

Cross-desktop libraries and common resources
GNU Lesser General Public License v3.0
129 stars 44 forks source link

Implement XAppStatusIcon #67

Closed clefebvre closed 5 years ago

clefebvre commented 5 years ago

XAppStatusIcon is an alternative to Gtk.StatusIcon and AppIndicator.

Gtk.StatusIcon features the following limitations:

AppIndicator solves some of these issues by delegating the rendering of the icon to the applet directly. The AppIndicator simply sends data info over DBUS and all is rendered on the other side natively by the applet. This solves HiDPI and rendering issues but the AppIndicator library has other limitations:

The idea behind XAppStatusIcon is to replace usage of Gtk.StatusIcon and AppIndicator so applets can render status icons natively (icon, label, tooltip) but let apps handle the context menu.

When a status icon is clicked, the event info is passed over dbus back to the app.

Last but not least, XAppStatusIcon checks for the presence of a running applet. If no applet is found, it falls back to a Gtk.StatusIcon and delegates to it. In other words, apps can use XAppStatusIcon, whether or not an applet is present to render it. If it's the case, the icon will be rendered natively by the applet, otherwise a Gtk.StatusIcon will be used as fallback. Apps don't need to worry about it.

An example of an app using an XAppStatusIcon, written in python, is available in test-scripts/xapp-status-icon.

An example of an applet, written in python/GTK, is available in test-scripts/xapp-status-applet.

Issues related to the Cinnamon applet:

Potential future improvements