The comment that was previously here assumed that `ItemIsMenu` should be
defined for any status item that has a menu, but the FreeDesktop spec
rather defines it as an item that "only supports the context menu", so
we should open the menu instead of trying to call `Activate`.
This change won't affect behavior if `ItemIsMenu` is true, but `Activate`
errors, except by opening the menu without having to wait for that
errror first. It will fix the left click to open menu behavior if any
client defines that method to not error, but does set `ItemIsMenu`.
This was added in https://github.com/pop-os/cosmic-applets/pull/1143,
but I don't think this code will ever be reached? This code is called
when activating an item in a menu, so it should only apply when there is
a menu.
We should use a more complicated method to lookup the icon from the
theme, but `cosmic-freedesktop-icons` will need some changes to be able
to accomodate a custom theme path.
This is probably an improvement. Anything that uses `IconThemePath`
is likely not working currently, so it won't make things worse.
It seems status icons, at least some, don't send property change
notifications. So we can't rely on that, and have to disable caching.
And handle the `NewIcon` signal defined in
https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem
I'm not sure whether or not there's a *good* reason it works this way,
but regardless I see `nm-applet` and `ibus` update their icons as
they should after these changes.
Comments in `gnome-shell-extension-appindicator` indicate this is
necessary for some clients. Checking the return value doesn't seem to
be.
There are more comments about Dropbox; more may be needed to fix it,
which doesn't seem to behave very properly.
This is at least one of the issue behind
https://github.com/pop-os/cosmic-applets/issues/165. OBS now shows it's
icon instead of an empty space. But the Mattermost flatpak doesn't show
anything. (Is that Flatpak related, or does it not use
`StatusNotifierItem`?)
Requires https://github.com/pop-os/libcosmic/pull/368. Ideally, it
should have some way to choose from multiple icons in memory of
different sizes.