mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-17 11:10:18 +00:00
Merge pull request #70 from ZoiteChat/fixtrayicon
Investigated the XFCE tray issue and confirmed the code path depe…
This commit is contained in:
3
.github/workflows/appimage-build.yml
vendored
3
.github/workflows/appimage-build.yml
vendored
@@ -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: |
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"finish-args": [
|
"finish-args": [
|
||||||
"--share=ipc",
|
"--share=ipc",
|
||||||
"--socket=wayland",
|
"--socket=wayland",
|
||||||
|
"--socket=fallback-x11",
|
||||||
"--share=network",
|
"--share=network",
|
||||||
"--socket=pulseaudio",
|
"--socket=pulseaudio",
|
||||||
"--filesystem=xdg-download",
|
"--filesystem=xdg-download",
|
||||||
@@ -15,8 +16,11 @@
|
|||||||
"--filesystem=xdg-data/icons:ro",
|
"--filesystem=xdg-data/icons:ro",
|
||||||
"--filesystem=~/.themes:ro",
|
"--filesystem=~/.themes:ro",
|
||||||
"--filesystem=~/.icons:ro",
|
"--filesystem=~/.icons:ro",
|
||||||
|
"--filesystem=xdg-run/tray-icon:create",
|
||||||
|
|
||||||
"--talk-name=org.freedesktop.Notifications",
|
"--talk-name=org.freedesktop.Notifications",
|
||||||
|
"--talk-name=org.kde.StatusNotifierWatcher",
|
||||||
|
"--talk-name=com.canonical.AppMenu.Registrar",
|
||||||
|
|
||||||
"--talk-name=org.mpris.MediaPlayer2.*"
|
"--talk-name=org.mpris.MediaPlayer2.*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -311,6 +311,19 @@ tray_gtk3_icon_to_name (TrayIcon icon, char **allocated)
|
|||||||
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
|
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
|
||||||
if (names && names[0])
|
if (names && names[0])
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Some StatusNotifier hosts (e.g. XFCE plugin combinations) can fail to
|
||||||
|
* resolve our desktop-id icon name even when GTK's icon theme lookup says
|
||||||
|
* it exists. Prefer an absolute PNG fallback for the app's normal icon so
|
||||||
|
* the tray item never renders as a blank placeholder.
|
||||||
|
*/
|
||||||
|
if (g_strcmp0 (names[0], ICON_NORMAL_NAME) == 0)
|
||||||
|
{
|
||||||
|
*allocated = tray_gtk3_fallback_icon_path_for_name (names[0]);
|
||||||
|
if (*allocated)
|
||||||
|
return *allocated;
|
||||||
|
}
|
||||||
|
|
||||||
theme = gtk_icon_theme_get_default ();
|
theme = gtk_icon_theme_get_default ();
|
||||||
if (theme && gtk_icon_theme_has_icon (theme, names[0]))
|
if (theme && gtk_icon_theme_has_icon (theme, names[0]))
|
||||||
return names[0];
|
return names[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user