Skip to content

desktop: force GDK_BACKEND=x11 to keep tray icon working on Wayland (closes #410) - #474

Merged
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:wayland-tray-icon-workaround
Apr 24, 2026
Merged

desktop: force GDK_BACKEND=x11 to keep tray icon working on Wayland (closes #410)#474
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:wayland-tray-icon-workaround

Conversation

@got3nks

@got3nks got3nks commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

aMule's tray icon uses wxWidgets' legacy XEmbed path (wxTaskBarIcon / CMuleTrayIcon), which does not surface on Wayland sessions — Wayland compositors don't host XEmbed clients, so the icon silently disappears on GNOME + gnome-shell-extension-appindicator and on KDE Plasma.

Until wxWidgets (or aMule) grows a libayatana-appindicator-based tray implementation, the pragmatic fix is to launch through XWayland: env GDK_BACKEND=x11 forces GTK onto the X11 backend, which composes with XEmbed correctly. Every major distro ships XWayland by default (Gentoo confirmed by @pacho2 in #410).

Closes #410.

Scope

Two .desktop files patched:

  • amule.desktop — monolithic aMule.
  • amulegui.desktop — the remote GUI. CamuleDlg::CreateSystray() (in src/amuleDlg.cpp) is compiled into both binaries (not gated by CLIENT_GUI), so both expose the same tray icon and need the same launch-path fix.

Trade-offs

  • Linux X11 (Xorg): no effect — GDK_BACKEND=x11 is already the default.
  • Linux Wayland + XWayland (default on every major distro): tray icon works.
  • Linux Wayland without XWayland: amule would fail to launch from the application menu. This is rare and self-inflicted (user deliberately removed the xwayland package). Launch from a terminal is unaffected because that path doesn't go through the .desktop file.
  • HiDPI Wayland: forcing the X11 path loses Wayland's fractional scaling. Minor visual trade for the tray icon actually appearing.
  • Windows / macOS: .desktop files are Linux-only, zero impact.

Future follow-up

A proper fix would be a libayatana-appindicator port of CMuleTrayIcon (out of scope for this PR); at that point the XWayland workaround can be removed.

Fixes amule-project#410.

aMule's tray icon uses wxWidgets' legacy XEmbed path (wxTaskBarIcon /
CMuleTrayIcon), which does not surface on Wayland sessions — Wayland
compositors don't host XEmbed clients, so the icon silently disappears
on GNOME + AyatanaIndicator/appindicator extension and on KDE Plasma.

Until wxWidgets (or aMule) grows a libayatana-appindicator-based tray
implementation, the pragmatic fix is to launch through XWayland:
env GDK_BACKEND=x11 forces GTK onto the X11 backend, which
composes with XEmbed correctly. Every major distro ships XWayland by
default (confirmed on Gentoo by pacho2 in amule-project#410), so the fallback is
available without user action.

Both .desktop files are patched: the tray icon is created in
CamuleDlg::CreateSystray() which is compiled into both the monolithic
amule and the remote amulegui (not gated by CLIENT_GUI), so both
entry points need the same treatment.

Trade-offs: on a Wayland host without XWayland, amule fails to launch
from the application menu — rare and self-inflicted. On HiDPI Wayland
displays the X11 path loses fractional scaling, but that's a minor
visual difference set against the tray icon actually working.
Launching from a terminal is unaffected.
@mrjimenez
mrjimenez merged commit 309662d into amule-project:master Apr 24, 2026
4 checks passed
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
got3nks added a commit to got3nks/amule that referenced this pull request May 1, 2026
The proper follow-up to amule-project#474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for amule-project#410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (amule-project#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes amule-project#410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in amule-project#474.
mrjimenez pushed a commit that referenced this pull request May 2, 2026
The proper follow-up to #474, which deliberately punted the
libayatana-appindicator port as "out of scope, future follow-up" and
shipped `Exec=env GDK_BACKEND=x11 amule` as the XEmbed-via-XWayland
workaround for #410.

Two related Linux-icon problems with one canonical fix.

== Dock / launcher icon ==

wxGTK 3.2 + GTK3 on Wayland derives the wl_app_id from
g_get_prgname(), which defaults to argv[0]. That diverges across
packaging formats: AppImage's argv[0] is "aMule", distro packages use
"amule", Flatpak renames the .desktop entirely. The compositor matches
wl_app_id against the .desktop filename to bind windows to the
launcher icon — without a deterministic value the icon is generic on
every Wayland desktop.

Fix: standardise on the canonical AppStream id `org.amule.aMule` —
matching the .desktop filename, the Wayland app_id (set explicitly via
g_set_prgname in CamuleApp::OnInit), the AppStream component id, and
the macOS bundle id. Drops the legacy `Exec=env GDK_BACKEND=x11 amule`
fallback from the .desktop files (#474).

== System tray icon ==

aMule's tray feature uses wxTaskBarIcon, which on wxGTK 3.2 (and 3.3 —
checked) talks the legacy GtkStatusIcon API. GNOME Shell removed the
legacy notification area in 3.26 and wlroots compositors never
implemented it, so the icon is silently invisible on Fedora / vanilla
GNOME / Sway / Hyprland. Ubuntu's GNOME Shell extension renders both
legacy and SNI; that's why the existing path appears to work on
Ubuntu but breaks elsewhere.

Fix: add a StatusNotifierItem (SNI) backend in MuleTrayIcon via
libayatana-appindicator3, gated on a configure-time pkg-config check.
When the dep is present (Linux), tray icon switches to the SNI path
with feature parity (full menu including live download/upload speed,
client info submenu, upload/download speed presets, connect/disconnect
/show/hide/exit). Menu rebuilds every 2s for live values. When the
dep is missing the legacy wxTaskBarIcon path is preserved unchanged.
Windows / macOS keep the existing wxTaskBarIcon → native shell
behaviour with zero changes.

== Dependencies ==

* New mandatory dep: glib-2.0 dev headers (Linux GUI build only).
  `g_set_prgname()` is needed to bind wl_app_id, and wxWidgets has no
  equivalent: `wxApp::SetAppName/SetClassName` are X11-only and
  deprecated, no wx method propagates to the Wayland surface. wxGTK
  transitively depends on glib but distro packaging doesn't always
  pull the dev headers as a hard dep, so we add an explicit
  `libglib2.0-dev` apt entry to ccpp.yml. The `g_set_prgname` call is
  wrapped in `#ifdef __WXGTK__` so Windows / macOS builds skip both
  the include and the call entirely — they don't need glib.

* New optional dep: libayatana-appindicator3 (Linux only). When
  found at configure time, enables the SNI tray backend. When
  missing, falls back to wxTaskBarIcon. Configure log reports which
  backend is in use.

== Files renamed ==

- amule.desktop                  -> org.amule.aMule.desktop
- amulegui.desktop               -> org.amule.aMule.gui.desktop
- amule.png                      -> org.amule.aMule.png
- org.amule.amule.metainfo.xml   -> org.amule.aMule.metainfo.xml
  (also bumps `<id>` to `org.amule.aMule`)

== Backwards compatibility ==

- Distro packagers: any .deb/.rpm referencing /usr/share/applications/
  amule.desktop has to update the path. One-line packaging change.
- AppStream catalog id changed (org.amule.amule -> org.amule.aMule).
  Software catalogues see this as a single new id.
- `wxApp::SetAppName("aMule")` is unchanged, so config-dir paths
  (~/.aMule/) are unaffected. User configs migrate without action.

Closes #410 properly, supersedes the GDK_BACKEND=x11 workaround
shipped in #474.
@got3nks
got3nks deleted the wayland-tray-icon-workaround branch May 3, 2026 15:20
ngosang added a commit to ngosang/amule that referenced this pull request Jul 13, 2026
…mule-project#474)

Surface the file comments & ratings REST feature (issue amule-project#419/amule-project#434) in the
Downloads and Shared Files detail panels, and restructure those panels into a
cleaner notebook layout.

Comments:
- New 'Comments' tab in both detail panels. Downloads shows the per-source
  comments/ratings list (username, rating, filename, comment, incl. retrieved
  Kad notes) from GET /downloads/{hash}/comments, a 'Get from Kad' trigger
  (POST) with a searching indicator, and an edit-your-own comment+rating form.
  Shared shows the edit form only (no live source list).
- Rating renders as text labels matching the desktop GetRateString() scale
  (0 Not rated .. 5 Excellent, -1 = comment only), colour-accented, not stars.
- The editor (shared CommentEditor component) is admin-only and, on Downloads,
  disabled until the file has >=1 complete part (the daemon only accepts a
  comment/rating on a shared file; otherwise PATCH 409 not_shared), with an
  inline hint.
- The Comments tab does not poll GET /downloads/{hash}; live detail polling is
  gated to the Details tab.

Detail-panel layout:
- SplitDetail lifted to the page level so the layout is table container ->
  splitter -> detail container as siblings, the detail no longer nested in the
  table's box.
- The panel is a notebook: file title + close button sit free at the top, the
  Details/Comments tab strip below, and only the active tab's content is boxed
  (.detail-body) and scrolls internally while the head + tabs stay fixed.
- Detail body spans the panel's full width (flush with the list container).
- Progress bar + pieces map moved into the Details tab.
- Copy ED2K / Copy magnet buttons moved into the Details tab's Hash row.
- Tighter header spacing and close-button alignment.

New en/es i18n keys and CSS included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

amule-2.3.3: tray icon not working on wayland

2 participants