Added a GTK3 AppIndicator tray backend with a unified tray interface while keeping the GtkStatusIcon backend for GTK2 builds.

Reworked tray menu population and tray initialization to use the backend abstraction and GTK3 menu refresh behavior.
Linked AppIndicator dependencies conditionally for GTK3 builds in Meson.
This commit is contained in:
2026-01-30 20:07:36 -07:00
parent d1e1ef3a82
commit 01104844e8
2 changed files with 337 additions and 135 deletions

View File

@@ -30,19 +30,30 @@ zoitechat_gtk_sources = [
zoitechat_gtk_cflags = []
zoitechat_gtk_deps = [
zoitechat_common_dep,
libgmodule_dep, # used by libsexy
]
if get_option('gtk3')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22')
zoitechat_gtk_cflags += '-DHAVE_GTK3'
appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false)
if appindicator_dep.found()
zoitechat_gtk_deps += appindicator_dep
zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR'
else
appindicator_dep = dependency('appindicator3-0.1', required: true)
zoitechat_gtk_deps += appindicator_dep
zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR'
endif
else
gtk_dep = dependency('gtk+-2.0', version: '>= 2.24.0')
zoitechat_gtk_cflags += '-DHAVE_GTK2'
endif
zoitechat_gtk_deps = [
zoitechat_common_dep,
libgmodule_dep, # used by libsexy
gtk_dep
]
zoitechat_gtk_deps += gtk_dep
if gtk_dep.get_pkgconfig_variable('target') == 'x11'
zoitechat_gtk_deps += dependency('x11')