Add AppIndicator/SNI support for system tray on Wayland (PR #26689)

18 views
Skip to first unread message

ykne

unread,
Jul 11, 2026, 7:02:24 PM (11 days ago) Jul 11
to wx-...@googlegroups.com, Subscribed

Use libayatana-appindicator3 (preferred) or libappindicator3 to implement wxTaskBarIcon using the StatusNotifierItem protocol, which is required for system tray functionality on Wayland.

When compiled in, IsAvailable() returns true unconditionally since SNI works on both X11 and Wayland. The icon is stored as a named icon in a temporary per-process XDG icon theme directory rather than in /tmp directly, avoiding hardcoded paths.

Adds --with-appindicator configure option (autotools) and wxUSE_APPINDICATOR cmake option. Detection tries
ayatana-appindicator3-0.1 first, then falls back to appindicator3-0.1. configure is regenerated with autoconf 2.69, matching the version that produced the current script.

New wxTaskBarIcon methods (GTK only):

  • SetSNIIconName(): set the D-Bus icon name directly
  • SetSNIIconThemePath(): set a custom icon theme search path
  • CreateSNIMenu(): override to provide a persistent menu

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26689

Commit Summary

  • 815b098 Add AppIndicator/SNI support for system tray on Wayland

File Changes

(11 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689@github.com>

ykne

unread,
Jul 11, 2026, 7:15:00 PM (11 days ago) Jul 11
to wx-...@googlegroups.com, Push

@ykne pushed 1 commit.

  • 7e27b6f Add AppIndicator/SNI support for system tray on Wayland


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/before/815b098543215e1b01af792ee3c692a6dc0f7939/after/7e27b6fa57cc25f2c80711f3ce510ed53b66ccc6@github.com>

ykne

unread,
Jul 11, 2026, 8:50:50 PM (11 days ago) Jul 11
to wx-...@googlegroups.com, Push

@ykne pushed 1 commit.

  • d2db425 Add AppIndicator/SNI support for system tray on Wayland


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/before/7e27b6fa57cc25f2c80711f3ce510ed53b66ccc6/after/d2db425b3e3c8dce62fd12b12fc5835774090fd6@github.com>

VZ

unread,
Jul 20, 2026, 7:34:29 PM (2 days ago) Jul 20
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks for your work on this!

We definitely want to have it (see at least #18081 and #25992), but we need to do it in master first — and then backport it to 3.2, after at least some testing. So could you please rebase this PR on master? This would also involve replacing NULLs with nullptrs, but AFAICS not much else needs to be changed.

Second, I'm a bit confused about the situation with the libraries:

  1. What is appindicator3 and where is it available? I am only aware of libayatana-appindicator3. Do we need to support this one and what advantages does it provide compared to the Ayatana version?
  2. Looking at libayatana-appindicator I see that it is marked as being obsolete and is apparently replaced by libayatana-appindicator-glib which, however, seems to be rather new and not widely available. Should we still try to optionally support it?

Finally, a question of terminology: "SNI" doesn't seem to be widely used and is difficult to search for because it has a completely different meaning in the HTTPS context. I'd avoid using it and use StatusNotifierItem in the messages. As for the function names, they should be called GTKSetXXX() instead, probably.

There may be more things to change, but the first thing to do is to retarget this to master, could you please do it in this PR or create a new one if it's more convenient? TIA!


In interface/wx/taskbar.h:

>          @since 3.1.5
     */
     virtual wxMenu* GetPopupMenu();
+
+    /**
+        Sets the icon name to use with the AppIndicator/SNI backend (GTK, Wayland).
+
+        When set, the named icon from the system icon theme is used instead of
+        converting the wxBitmap passed to SetIcon() to a temporary PNG file.
+        Must be called before SetIcon(). Has no effect on non-GTK ports or when
+        AppIndicator support is not compiled in.
+
+        @param name  Icon name as found in the hicolor icon theme (e.g. "myapp").
+
+        @onlyfor{wxgtk}
+        @since 3.2.12
⬇️ Suggested change
-        @since 3.2.12
+        @since 3.3.4

In interface/wx/taskbar.h:

> +        @onlyfor{wxgtk}
+        @since 3.2.12
+    */
+    void SetSNIIconName(const wxString& name);
+
+    /**
+        Sets an extra icon theme search path for the AppIndicator/SNI backend.
+
+        Registers an additional directory with GTK's icon theme so that named
+        icons set via SetSNIIconName() can be found without being installed to
+        the system theme. Useful for uninstalled or development builds.
+
+        @param path  Directory containing a hicolor icon theme subtree.
+
+        @onlyfor{wxgtk}
+        @since 3.2.12
⬇️ Suggested change
-        @since 3.2.12
+        @since 3.3.4


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/review/4739649364@github.com>

VZ

unread,
Jul 21, 2026, 10:33:50 AM (yesterday) Jul 21
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26689)

Closing in favour of #26715.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/c5035319587@github.com>

VZ

unread,
Jul 21, 2026, 10:33:51 AM (yesterday) Jul 21
to wx-...@googlegroups.com, Subscribed

Closed #26689.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/issue_event/28274620255@github.com>

ykne

unread,
Jul 21, 2026, 12:55:58 PM (yesterday) Jul 21
to wx-...@googlegroups.com, Subscribed
ykne left a comment (wxWidgets/wxWidgets#26689)

3.2 port is needed because latest as of now Fedora 44 enforces Wayland and ships 3.2.x.
This PR is actually a backport from master #26715.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/c5036739440@github.com>

VZ

unread,
Jul 21, 2026, 1:00:13 PM (yesterday) Jul 21
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26689)

We need to apply it to master first and then backport it and there probably will be some changes, so it's less confusing to have one pending PR than 2 of them.

Also, if you could address questions in my comment above in the new PR, it would be great, TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/c5036780450@github.com>

ykne

unread,
Jul 21, 2026, 1:09:51 PM (yesterday) Jul 21
to wx-...@googlegroups.com, Subscribed

@ykne commented on this pull request.


In interface/wx/taskbar.h:

> +        @onlyfor{wxgtk}
+        @since 3.2.12
+    */
+    void SetSNIIconName(const wxString& name);
+
+    /**
+        Sets an extra icon theme search path for the AppIndicator/SNI backend.
+
+        Registers an additional directory with GTK's icon theme so that named
+        icons set via SetSNIIconName() can be found without being installed to
+        the system theme. Useful for uninstalled or development builds.
+
+        @param path  Directory containing a hicolor icon theme subtree.
+
+        @onlyfor{wxgtk}
+        @since 3.2.12

@vadz Thank you for your questions.

I am using libindicator, as provided by the latest Fedora releases. I saw the note that the -glib version should be used going forward, but it is not available in Fedora.

This project started because the tray icon in https://github.com/pwsafe/pwsafe does not appear under Wayland. I am not an expert in either wxWidgets or the indicator code; this was just a quick fix to get the tray icon working to some extent.

I would really appreciate a detailed code review.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26689/review/4747112327@github.com>

Reply all
Reply to author
Forward
0 new messages