Investigated the XFCE tray issue and confirmed the code path depends on build-time AppIndicator availability: GTK3 uses AppIndicator/StatusNotifier only when Ayatana/AppIndicator headers/libs were present at compile time; otherwise it falls back to GtkStatusIcon behavior. That fallback is less reliable across XFCE setups, which explains why one user could miss the tray icon.

Added a new Meson feature option appindicator (default auto) so this backend is explicitly controllable.

    Updated GTK Meson logic to honor -Dappindicator=... and fail fast if enabled is requested but neither ayatana-appindicator3-0.1 nor appindicator3-0.1 is found (prevents silently shipping a build without AppIndicator tray support).

    Updated AppImage CI configure flags to force -Dappindicator=enabled, which should prevent AppImage artifacts from lacking StatusNotifier/AppIndicator tray support in XFCE-like environments.
This commit is contained in:
2026-02-22 06:58:24 -07:00
parent a459d0a086
commit acb8d2f539
3 changed files with 18 additions and 8 deletions

View File

@@ -47,7 +47,8 @@ jobs:
-Dtext-frontend=true \ -Dtext-frontend=true \
-Dwith-perl=perl \ -Dwith-perl=perl \
-Dwith-python=python3 \ -Dwith-python=python3 \
-Dauto_features=enabled -Dauto_features=enabled \
-Dappindicator=enabled
- name: Build - name: Build
run: | run: |

View File

@@ -22,6 +22,9 @@ option('dbus', type: 'feature', value: 'auto',
option('libcanberra', type: 'feature', value: 'auto', option('libcanberra', type: 'feature', value: 'auto',
description: 'Support for sound alerts, Unix only' description: 'Support for sound alerts, Unix only'
) )
option('appindicator', type: 'feature', value: 'auto',
description: 'Use Ayatana/AppIndicator-based tray backend when GTK3 is enabled'
)
# Install options # Install options
option('dbus-service-use-appid', type: 'boolean', value: false, option('dbus-service-use-appid', type: 'boolean', value: false,

View File

@@ -40,15 +40,21 @@ if get_option('gtk3')
zoitechat_gtk_cflags += '-DHAVE_GTK3' zoitechat_gtk_cflags += '-DHAVE_GTK3'
if host_machine.system() != 'windows' if host_machine.system() != 'windows'
appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false) appindicator_opt = get_option('appindicator')
if appindicator_dep.found()
zoitechat_gtk_deps += appindicator_dep if appindicator_opt.allowed()
zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR' appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false)
else
appindicator_dep = dependency('appindicator3-0.1', required: false)
if appindicator_dep.found() if appindicator_dep.found()
zoitechat_gtk_deps += appindicator_dep zoitechat_gtk_deps += appindicator_dep
zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR' zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR'
else
appindicator_dep = dependency('appindicator3-0.1', required: false)
if appindicator_dep.found()
zoitechat_gtk_deps += appindicator_dep
zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR'
elif appindicator_opt.enabled()
error('appindicator=enabled, but neither ayatana-appindicator3-0.1 nor appindicator3-0.1 was found')
endif
endif endif
endif endif
endif endif