sway/swaybar
Joan Bruguera Micó f23d100747 swaybar: Emit property changes for SNI watcher
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:
03483ff370/swaybar/tray/tray.c (L57)

(*) Note that the libappindicator-gtk3 library has been mostly replaced
    by libayatana-appindicator, which is not affected by this.
    The affected version is still used by Arch Linux, source code at:
    https://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk/files/298
2024-11-10 20:42:02 +01:00
..
tray swaybar: Emit property changes for SNI watcher 2024-11-10 20:42:02 +01:00
bar.c swaybar: Fix 100% cpu usage if dbus dies. 2024-09-28 16:23:21 +02:00
config.c Define _POSIX_C_SOURCE globally 2024-02-23 17:43:19 +03:00
i3bar.c Define _POSIX_C_SOURCE globally 2024-02-23 17:43:19 +03:00
image.c common: move load_image to swaybar 2023-11-23 20:42:04 +01:00
input.c swaybar: Implement wp_cursor_shape_v1 2023-07-31 10:34:11 +02:00
ipc.c swaybar: Fix 100% cpu usage if dbus dies. 2024-09-28 16:23:21 +02:00
main.c Define _POSIX_C_SOURCE globally 2024-02-23 17:43:19 +03:00
meson.build common: move load_image to swaybar 2023-11-23 20:42:04 +01:00
render.c Define _POSIX_C_SOURCE globally 2024-02-23 17:43:19 +03:00
status_line.c Define _POSIX_C_SOURCE globally 2024-02-23 17:43:19 +03:00
swaybar-protocol.7.scd man: update maintainer 2021-01-08 09:33:51 +01:00