mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 22:43:58 +01:00
f23d100747
Emit property change signals for the IsStatusNotifierHostRegistered and
RegisteredStatusNotifierItems properties in StatusNotifierWatcher,
so code relying on the PropertiesChanged signal, instead of signals
such as StatusNotifierHostRegistered, can work properly.
A library that is affected by this is the libappindicator-gtk3* library
and it can cause tray icons to be missing after starting swaybar due to
a race condition, as follows:
* An application using libappindicator-gtk3 starts, e.g. nm-applet.
* Some time later, swaybar starts.
* swaybar creates the StatusNotifierWatcher.
* libappindicator-gtk3 observes the new watcher, but it sees that
IsStatusNotifierHostRegistered=false, so it falls back to the
Freedesktop System tray protocol.
* swaybar creates the StatusNotifierHost.
At this point, libappindicator-gtk3 should "un-fallback" back to SNI.
However, since swaybar does not emit the PropertiesChange signal on
IsStatusNotifierHostRegistered, libappindicator-gtk3 doesn't get
notified, and stays in fallback state forever.
* As a result, nm-applet will not show in the swaybar tray.
This race can be made reliable by inserting a 1-second long sleep here:
|
||
---|---|---|
.. | ||
host.c | ||
icon.c | ||
item.c | ||
tray.c | ||
watcher.c |