diff -Nru pasystray-0.6.0/bootstrap.sh pasystray-0.7.0/bootstrap.sh --- pasystray-0.6.0/bootstrap.sh 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/bootstrap.sh 2018-09-28 15:20:16.000000000 +0000 @@ -1,3 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + rm -rf autom4te.cache rm -f config.cache aclocal diff -Nru pasystray-0.6.0/configure.ac pasystray-0.7.0/configure.ac --- pasystray-0.6.0/configure.ac 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/configure.ac 2018-09-28 15:20:16.000000000 +0000 @@ -1,6 +1,6 @@ # This file is part of PaSystray # -# Copyright (C) 2011-2016 Christoph Gysin +# Copyright (C) 2011-2018 Christoph Gysin # # PaSystray is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -19,7 +19,7 @@ AC_PREREQ([2.68]) -AC_INIT([pasystray], [0.6.0], [christoph.gysin@gmail.com], [pasystray], +AC_INIT([pasystray], [0.7.0], [christoph.gysin@gmail.com], [pasystray], [http://github.com/christophgysin/pasystray]) AC_CONFIG_SRCDIR([src/pasystray.c]) AC_CONFIG_HEADERS([src/config.h]) @@ -31,8 +31,12 @@ AC_ARG_WITH(gtk, AC_HELP_STRING([--with-gtk=2|3], [choose GTK version (default: 3)]),, with_gtk=3) AC_MSG_CHECKING([GTK version to use]) case ${with_gtk} in - 2) GTK_VERSION=gtk+-2.0;; - 3) GTK_VERSION=gtk+-3.0;; + 2) GTK_VERSION=gtk+-2.0 + GTK_VERSION_MAJOR=2 + ;; + 3) GTK_VERSION=gtk+-3.0 + GTK_VERSION_MAJOR=3 + ;; *) AC_MSG_ERROR([unknown GTK version!]);; esac AC_MSG_RESULT($GTK_VERSION) @@ -41,6 +45,7 @@ AC_DEFINE_UNQUOTED(GTK_VERSION_MAJOR, $with_gtk, [Have GTK version?]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) +AC_SUBST(GTK_VERSION_MAJOR) ### check for pulseaudio libs ################################################# PKG_CHECK_MODULES(PULSEAUDIO, [ libpulse >= 1.0 libpulse-mainloop-glib >= 1.0 ]) diff -Nru pasystray-0.6.0/debian/changelog pasystray-0.7.0/debian/changelog --- pasystray-0.6.0/debian/changelog 2016-07-23 03:12:10.000000000 +0000 +++ pasystray-0.7.0/debian/changelog 2018-10-29 12:29:50.000000000 +0000 @@ -1,10 +1,17 @@ -pasystray (0.6.0-1ubuntu1) yakkety; urgency=medium +pasystray (0.7.0-1) unstable; urgency=low - * Merge from Debian unstable. Remaining changes: - - debian/control: Build-depend on libappindicator3-dev for indicator - support. + * New upstream release (Closes: #761053) + * Replace deprecated "extra" priority with "optional" + * Bump debhelper version + * Update copyright URL to HTTPS + * Bump standards version + * Replace deprecated gnome-icon-theme dependency (Closes: #823122) + * Add patch to build against Ayatana AppIndicator. + Thanks to Mike Gabriel for the patch (Closes: #827458, #861387, #898612) + * Add patch to require X11 backend. + Thanks to Simon McVittie for the suggestion (Closes: #864044) - -- Logan Rosen Fri, 22 Jul 2016 23:11:26 -0400 + -- Scott Leggett Mon, 29 Oct 2018 23:29:50 +1100 pasystray (0.6.0-1) unstable; urgency=low @@ -14,12 +21,6 @@ -- Scott Leggett Mon, 18 Jul 2016 23:19:07 +1000 -pasystray (0.5.2-1ubuntu1) yakkety; urgency=medium - - * d/control: Build-dep on libappindicator3-dev for indicator support. - - -- Unit 193 Thu, 02 Jun 2016 21:24:38 -0400 - pasystray (0.5.2-1) unstable; urgency=low * New upstream release 0.5.2 (Closes: #792461) @@ -40,4 +41,3 @@ * Initial release (Closes: #729205) -- Scott Leggett Sun, 10 Nov 2013 18:00:59 +1100 - diff -Nru pasystray-0.6.0/debian/compat pasystray-0.7.0/debian/compat --- pasystray-0.6.0/debian/compat 2016-07-19 04:42:23.000000000 +0000 +++ pasystray-0.7.0/debian/compat 2018-10-29 12:29:50.000000000 +0000 @@ -1 +1 @@ -9 +11 diff -Nru pasystray-0.6.0/debian/control pasystray-0.7.0/debian/control --- pasystray-0.6.0/debian/control 2016-07-19 04:42:23.000000000 +0000 +++ pasystray-0.7.0/debian/control 2018-10-29 12:29:50.000000000 +0000 @@ -1,28 +1,25 @@ Source: pasystray Section: sound -Priority: extra -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Scott Leggett +Priority: optional +Maintainer: Scott Leggett Build-Depends: - autotools-dev, - debhelper (>= 9.0.0), - dh-autoreconf, - libappindicator3-dev, + debhelper (>= 11.0.0), libavahi-client-dev, libavahi-glib-dev, + libayatana-appindicator3-dev, libgtk-3-dev, libnotify-dev, libpulse-dev, pkg-config -Standards-Version: 3.9.8 +Standards-Version: 4.2.1 Homepage: https://github.com/christophgysin/pasystray -Vcs-Git: https://gitlab.com/smlx/pasystray.git -Vcs-Browser: https://gitlab.com/smlx/pasystray +Vcs-Git: https://salsa.debian.org/smlx-guest/pasystray.git +Vcs-Browser: https://salsa.debian.org/smlx-guest/pasystray Package: pasystray Architecture: any Depends: - gnome-icon-theme, + adwaita-icon-theme, ${misc:Depends}, ${shlibs:Depends} Suggests: diff -Nru pasystray-0.6.0/debian/copyright pasystray-0.7.0/debian/copyright --- pasystray-0.6.0/debian/copyright 2016-07-19 04:42:23.000000000 +0000 +++ pasystray-0.7.0/debian/copyright 2018-10-29 12:29:50.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pasystray Source: https://github.com/christophgysin/pasystray diff -Nru pasystray-0.6.0/debian/patches/0001-Build-against-ayatana-appindicator.patch pasystray-0.7.0/debian/patches/0001-Build-against-ayatana-appindicator.patch --- pasystray-0.6.0/debian/patches/0001-Build-against-ayatana-appindicator.patch 1970-01-01 00:00:00.000000000 +0000 +++ pasystray-0.7.0/debian/patches/0001-Build-against-ayatana-appindicator.patch 2018-10-29 12:29:50.000000000 +0000 @@ -0,0 +1,37 @@ +From: Scott Leggett +Date: Fri, 26 Oct 2018 23:23:06 +1100 +Subject: Build against ayatana-appindicator + +--- + configure.ac | 4 ++-- + src/systray_impl.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2a4ad4a..5e22c28 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -123,8 +123,8 @@ AC_ARG_ENABLE([appindicator], + AS_HELP_STRING([--disable-appindicator], [Disable optional appindicator support])) + + case ${with_gtk} in +- 2) APPINDICATOR_VERSION=appindicator-0.1;; +- 3) APPINDICATOR_VERSION=appindicator3-0.1;; ++ 2) APPINDICATOR_VERSION=ayatana-appindicator-0.1;; ++ 3) APPINDICATOR_VERSION=ayatana-appindicator3-0.1;; + esac + AS_IF([test "x$enable_appindicator" != xno], + [PKG_CHECK_MODULES(APPINDICATOR, [ $APPINDICATOR_VERSION ], HAVE_APPINDICATOR=1, +diff --git a/src/systray_impl.c b/src/systray_impl.c +index 12f4db2..1de95f0 100644 +--- a/src/systray_impl.c ++++ b/src/systray_impl.c +@@ -26,7 +26,7 @@ + + #ifdef HAVE_APPINDICATOR + +-#include ++#include + + static void systray_impl_scroll_cb(AppIndicator* appind, gint delta, GdkScrollDirection direction, gpointer userdata) + { diff -Nru pasystray-0.6.0/debian/patches/0002-Require-X11-backend.patch pasystray-0.7.0/debian/patches/0002-Require-X11-backend.patch --- pasystray-0.6.0/debian/patches/0002-Require-X11-backend.patch 1970-01-01 00:00:00.000000000 +0000 +++ pasystray-0.7.0/debian/patches/0002-Require-X11-backend.patch 2018-10-29 12:29:50.000000000 +0000 @@ -0,0 +1,20 @@ +From: Scott Leggett +Date: Mon, 29 Oct 2018 22:40:16 +1100 +Subject: Require X11 backend + +--- + src/pasystray.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/pasystray.c b/src/pasystray.c +index a17dea8..a5bf321 100644 +--- a/src/pasystray.c ++++ b/src/pasystray.c +@@ -37,6 +37,7 @@ static menu_infos_t* mis; + + int main(int argc, char *argv[]) + { ++ gdk_set_allowed_backends ("x11"); + GOptionEntry* options = get_options(); + GError *error = NULL; + gtk_init_with_args(&argc, &argv, NULL, options, NULL, &error); diff -Nru pasystray-0.6.0/debian/patches/series pasystray-0.7.0/debian/patches/series --- pasystray-0.6.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ pasystray-0.7.0/debian/patches/series 2018-10-29 12:29:50.000000000 +0000 @@ -0,0 +1,2 @@ +0001-Build-against-ayatana-appindicator.patch +0002-Require-X11-backend.patch diff -Nru pasystray-0.6.0/Makefile.am pasystray-0.7.0/Makefile.am --- pasystray-0.6.0/Makefile.am 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/Makefile.am 2018-09-28 15:20:16.000000000 +0000 @@ -1,6 +1,6 @@ # This file is part of PaSystray # -# Copyright (C) 2011-2015 Christoph Gysin +# Copyright (C) 2011-2016 Christoph Gysin # # PaSystray is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -17,21 +17,29 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. +EXTRA_DIST = \ + LICENSE \ + README.md \ + bootstrap.sh + iconsdir = $(datadir)/icons/hicolor/scalable/apps icons_DATA = data/pasystray.svg +EXTRA_DIST += $(icons_DATA) pixmapsdir = $(datadir)/pixmaps pixmaps_DATA = data/pasystray.png +EXTRA_DIST += $(pixmaps_DATA) desktopdir = $(datadir)/applications desktop_DATA = data/pasystray.desktop +EXTRA_DIST += $(desktop_DATA) xdgautostartdir = $(sysconfdir)/xdg/autostart xdgautostart_DATA = data/pasystray.desktop +EXTRA_DIST += $(xdgautostart_DATA) man_MANS = man/pasystray.1 - -EXTRA_DIST = bootstrap.sh README.md LICENSE $(icons_DATA) $(pixmaps_DATA) $(desktop_DATA) +EXTRA_DIST += $(man_MANS) SUBDIRS = src diff -Nru pasystray-0.6.0/man/pasystray.1 pasystray-0.7.0/man/pasystray.1 --- pasystray-0.6.0/man/pasystray.1 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/man/pasystray.1 2018-09-28 15:20:16.000000000 +0000 @@ -1,10 +1,10 @@ .\" (C) Copyright 2013 Scott Leggett , -.\" (C) Copyright 2015 Christoph Gysin +.\" (C) Copyright 2015-2016 Christoph Gysin .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH PASYSTRAY 1 "November 9, 2013" +.TH PASYSTRAY 1 "June 14, 2018" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -100,6 +100,9 @@ .B \-i, \-\-volume-inc=N Set the volume increment. .TP +.B \-t, \-\-no-icon-tooltip +Disable the status icon tooltip for the connected state. +.TP .B \-n, \-\-no-notify Disable all notifications. .TP diff -Nru pasystray-0.6.0/src/avahi.c pasystray-0.7.0/src/avahi.c --- pasystray-0.6.0/src/avahi.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/avahi.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/avahi.h pasystray-0.7.0/src/avahi.h --- pasystray-0.6.0/src/avahi.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/avahi.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/Makefile.am pasystray-0.7.0/src/Makefile.am --- pasystray-0.6.0/src/Makefile.am 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/Makefile.am 2018-09-28 15:20:16.000000000 +0000 @@ -1,6 +1,6 @@ # This file is part of PaSystray # -# Copyright (C) 2011-2015 Christoph Gysin +# Copyright (C) 2011-2016 Christoph Gysin # # PaSystray is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -18,9 +18,11 @@ # USA. gladedir = $(pkgdatadir) +gladefile = pasystray.gtk$(GTK_VERSION_MAJOR).glade +glade_DATA = $(gladefile) +EXTRA_DIST = $(glade_DATA) bin_PROGRAMS = pasystray -glade_DATA = pasystray.glade pasystray_SOURCES = \ avahi.c \ @@ -66,7 +68,4 @@ $(APPINDICATOR_CFLAGS) \ $(X11_CFLAGS) \ -DG_LOG_DOMAIN=\"pasystray\" \ - -DGLADE_FILE=\"$(gladedir)/pasystray.glade\" - -EXTRA_DIST = \ - $(glade_DATA) + -DGLADE_FILE=\"$(gladedir)/$(gladefile)\" diff -Nru pasystray-0.6.0/src/menu_info.c pasystray-0.7.0/src/menu_info.c --- pasystray-0.6.0/src/menu_info.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/menu_info.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -231,28 +231,39 @@ return; } - menu_infos_t* mis = item->menu_info->menu_infos; - g_debug("[menu_info] updating %s %u %s (target: %d)", menu_info_type_name(item->menu_info->type), index, desc, (int)target); - g_free(item->name); - item->name = g_strdup(name); + if (name != item->name) + { + g_free(item->name); + item->name = g_strdup(name); + } - g_free(item->desc); - item->desc = g_strdup(desc); + if (desc != item->desc) + { + g_free(item->desc); + item->desc = g_strdup(desc); + } /* only notify on volume / mute changes */ int notify = 0; if ((vol && !pa_cvolume_equal(item->volume, vol)) || mute != item->mute) notify = 1; - g_free(item->volume); - item->volume = g_memdup(vol, sizeof(pa_cvolume)); + if (vol != item->volume) + { + g_free(item->volume); + item->volume = g_memdup(vol, sizeof(pa_cvolume)); + } item->mute = mute; item->target = target; - g_free(item->address); - item->address = g_strdup(address); + + if (address != item->address) + { + g_free(item->address); + item->address = g_strdup(address); + } menu_type_t submenu_type = menu_info_submenu_type(mi->type); menu_info_t* submenu = &mi->menu_infos->menu_info[submenu_type]; @@ -261,7 +272,8 @@ gtk_menu_item_set_label(GTK_MENU_ITEM(item->widget), label); g_free(label); - systray_set_tooltip(GTK_WIDGET(item->widget), tooltip); + if (tooltip) + systray_set_tooltip(GTK_WIDGET(item->widget), tooltip); switch(mi->type) { @@ -285,8 +297,8 @@ if(mi->type == MENU_SINK && item == menu_info_item_get_by_name(mi, mi->default_name)) ui_update_systray_icon(item); - if(notify && mis->settings.notify == NOTIFY_ALWAYS) - pulseaudio_update_volume_notification(item); + if(notify) + pulseaudio_process_update_volume_notification(item); } void menu_info_item_add(menu_info_t* mi, uint32_t index, const char* name, @@ -389,7 +401,7 @@ case MENU_SOURCE: { menu_type_t type = (mii->menu_info->type == MENU_SINK) ? MENU_INPUT : MENU_OUTPUT; - gchar* label = g_strdup_printf("move all %ss here", + gchar* label = g_strdup_printf("Move all %ss here", menu_info_type_name(type)); item = gtk_menu_item_new_with_label(label); g_free(label); @@ -397,14 +409,14 @@ G_CALLBACK(menu_info_item_move_all_cb), mii); gtk_menu_shell_append(menu, item); - item = gtk_menu_item_new_with_label("rename"); + item = gtk_menu_item_new_with_label("Rename"); g_signal_connect(item, "button-press-event", G_CALLBACK(menu_info_item_rename_cb), mii); gtk_menu_shell_append(menu, item); break; } case MENU_MODULE: - item = gtk_menu_item_new_with_label("unload"); + item = gtk_menu_item_new_with_label("Unload"); g_signal_connect(item, "button-press-event", G_CALLBACK(menu_info_module_unload_cb), mii); gtk_menu_shell_append(menu, item); diff -Nru pasystray-0.6.0/src/menu_info.h pasystray-0.7.0/src/menu_info.h --- pasystray-0.6.0/src/menu_info.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/menu_info.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -55,17 +55,21 @@ char* default_name; }; -typedef enum { - NOTIFY_NEVER, - NOTIFY_DEFAULT, - NOTIFY_ALWAYS, -} notify_t; - struct settings_t_ { int volume_max; int volume_inc; - notify_t notify; + gboolean icon_tooltip; gboolean monitors; + // Notification options below + gboolean n_new; + gboolean n_sink; + gboolean n_sink_default; + gboolean n_source; + gboolean n_source_default; + gboolean n_stream; + gboolean n_stream_output; + gboolean n_stream_input; + gboolean n_systray_action; }; typedef struct settings_t_ settings_t; diff -Nru pasystray-0.6.0/src/notify.c pasystray-0.7.0/src/notify.c --- pasystray-0.6.0/src/notify.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/notify.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -26,8 +26,8 @@ #include "notify.h" void notify_initialize(){} -notify_handle_t notify(const char* msg, const char* body, const char* icon){ return 0; } -void notify_update(notify_handle_t h, const char* msg, const char* body, const char* icon){} +notify_handle_t notify(const char* msg, const char* body, const char* icon, gint value){ return 0; } +void notify_update(notify_handle_t h, const char* msg, const char* body, const char* icon, gint value){} #else @@ -51,6 +51,8 @@ notify_handle_t notify(const char* msg, const char* body, const char* icon, gint value) { + if(!icon) + icon = "audio-card"; NotifyNotification* n = notify_notification_new(msg, body, icon); notify_notification_set_urgency(n, NOTIFY_URGENCY_LOW); notify_notification_set_timeout(n, 2000); // timeout in ms @@ -62,6 +64,8 @@ void notify_update(notify_handle_t h, const char* msg, const char* body, const char* icon, gint value) { + if(!icon) + icon = "audio-card"; NotifyNotification* n = (NotifyNotification*) h; notify_notification_set_timeout(n, 2000); // timeout in ms if(value > -1) diff -Nru pasystray-0.6.0/src/notify.h pasystray-0.7.0/src/notify.h --- pasystray-0.6.0/src/notify.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/notify.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -22,6 +22,8 @@ #ifndef PASYSTRAY_NOTIFY_H #define PASYSTRAY_NOTIFY_H +#include + #include "config.h" typedef void* notify_handle_t; diff -Nru pasystray-0.6.0/src/options.c pasystray-0.7.0/src/options.c --- pasystray-0.6.0/src/options.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/options.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -29,21 +29,27 @@ static gboolean debug = FALSE; static int volume_max = 0; static int volume_inc = 1; +static gboolean icon_tooltip = TRUE; static gboolean no_notify = FALSE; static gboolean always_notify = FALSE; static gboolean monitors = FALSE; +static gchar **notify_mode; static GOptionEntry entries[] = { - { "version", 'V', 0, G_OPTION_ARG_NONE, &version, "print version and exit", NULL }, - { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "print debugging information", NULL }, - { "max-volume", 0, 0, G_OPTION_ARG_INT, &volume_max, "deprecated, use volume-max instead", "N" }, - { "volume-max", 'm', 0, G_OPTION_ARG_INT, &volume_max, "maximum volume (in percent)", "N" }, - { "volume-inc", 'i', 0, G_OPTION_ARG_INT, &volume_inc, "volume increment", "N" }, - { "no-notify", 'n', 0, G_OPTION_ARG_NONE, &no_notify, "disable all notifications", NULL }, + { "version", 'V', 0, G_OPTION_ARG_NONE, &version, "Print version and exit", NULL }, + { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Print debugging information", NULL }, + { "volume-max", 'm', 0, G_OPTION_ARG_INT, &volume_max, "Maximum volume (in percent)", "N" }, + { "volume-inc", 'i', 0, G_OPTION_ARG_INT, &volume_inc, "Volume increment", "N" }, + { "no-icon-tooltip", 't', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, + &icon_tooltip, "Disable the status icon tooltip for the connected state", NULL }, + { "no-notify", 'n', 0, G_OPTION_ARG_NONE, &no_notify, + "Deprecated, use --notify=none instead", NULL }, { "always-notify", 'a', 0, G_OPTION_ARG_NONE, &always_notify, - "enable notifications for all changes in pulsaudio", NULL }, - { "include-monitors", 'n', 0, G_OPTION_ARG_NONE, &monitors, "include monitor sources", NULL }, + "Deprecated, use --notify=all instead", NULL }, + { "include-monitors", 'n', 0, G_OPTION_ARG_NONE, &monitors, "Include monitor sources", NULL }, + { "notify", 'N', 0, G_OPTION_ARG_STRING_ARRAY, ¬ify_mode, + "Set notification options, use --notify=help for a list of valid options", "OPTION" }, { .long_name = NULL } }; @@ -52,6 +58,43 @@ return entries; } +// Set some default values close to previous behavior +void notify_default(settings_t* settings) +{ + settings->n_new = TRUE; + settings->n_sink = FALSE; + settings->n_sink_default = FALSE; + settings->n_source = FALSE; + settings->n_source_default = FALSE; + settings->n_stream_output = FALSE; + settings->n_stream_input = FALSE; + settings->n_systray_action = TRUE; +} + +void notify_all(settings_t* settings) +{ + settings->n_new = TRUE; + settings->n_sink = TRUE; + settings->n_sink_default = TRUE; + settings->n_source = TRUE; + settings->n_source_default = TRUE; + settings->n_stream_output = TRUE; + settings->n_stream_input = TRUE; + settings->n_systray_action = TRUE; +} + +void notify_none(settings_t* settings) +{ + settings->n_new = FALSE; + settings->n_sink = FALSE; + settings->n_sink_default = FALSE; + settings->n_source = FALSE; + settings->n_source_default = FALSE; + settings->n_stream_output = FALSE; + settings->n_stream_input = FALSE; + settings->n_systray_action = FALSE; +} + void parse_options(settings_t* settings) { if(version) @@ -77,14 +120,95 @@ settings->volume_inc = volume_inc; } - settings->notify = NOTIFY_DEFAULT; + settings->icon_tooltip = icon_tooltip; + + notify_default(settings); + + if(notify_mode) + { + for (int i = 0; notify_mode[i]; i++) { + if(!g_strcmp0(notify_mode[i], "all")) + { + notify_all(settings); + } + else if(g_str_equal(notify_mode[i], "none")) + { + notify_none(settings); + } + else if(g_str_equal(notify_mode[i], "new")) + { + settings->n_new = TRUE; + } + else if(g_str_equal(notify_mode[i], "sink")) + { + settings->n_sink = TRUE; + } + else if(g_str_equal(notify_mode[i], "sink_default")) + { + settings->n_sink_default = TRUE; + } + else if(g_str_equal(notify_mode[i], "source")) + { + settings->n_source = TRUE; + } + else if(g_str_equal(notify_mode[i], "source_default")) + { + settings->n_source_default = TRUE; + } + else if(g_str_equal(notify_mode[i], "stream")) + { + settings->n_stream_output = TRUE; + settings->n_stream_input = TRUE; + } + else if(g_str_equal(notify_mode[i], "stream_output")) + { + settings->n_stream_output = TRUE; + } + else if(g_str_equal(notify_mode[i], "stream_input")) + { + settings->n_stream_input = TRUE; + } + else if(g_str_equal(notify_mode[i], "systray_action")) + { + settings->n_systray_action = TRUE; + } + else if(g_str_equal(notify_mode[i], "help")) + { + gchar *help_text=( + "Notification options:\n" + " all Notify for all detected changes\n" + " none Never notify, except for options set after this one\n" + " new Notify when new sinks/sources are added\n" + " sink Notify for changes to all sinks\n" + " sink_default Notify for changes to the default sink\n" + " source Notify for changes to all sources\n" + " source_default Notify for changes to the default source\n" + " stream Notify for all streams\n" + " stream_output Notify for output (playback) streams\n" + " stream_input Notify for input (recording) streams\n" + " systray_action Notify for changes made through pasystray\n" + " help List possible options and exit\n" + ); + + g_print("%s",help_text); + exit(0); + } + else + { + g_print("Warning: Invalid notification option \"%s\". Run 'pasystray --notify=help' for a list of valid options.\n", notify_mode[i]); + } + } + } + if(no_notify) { - settings->notify = NOTIFY_NEVER; + g_warning("--no-notify is deprecated, use --notify=none instead"); + notify_none(settings); } if(always_notify) { - settings->notify = NOTIFY_ALWAYS; + g_warning("--always-notify is deprecated, use --notify=all instead"); + notify_all(settings); } settings->monitors = monitors; diff -Nru pasystray-0.6.0/src/options.h pasystray-0.7.0/src/options.h --- pasystray-0.6.0/src/options.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/options.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/pasystray.c pasystray-0.7.0/src/pasystray.c --- pasystray-0.6.0/src/pasystray.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pasystray.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -67,9 +67,9 @@ ui_load(); mis = menu_infos_create(); + mis->settings = *settings; systray_create(mis); menu_infos_init(mis); - mis->settings = *settings; pulseaudio_init(mis); avahi_start(mis); diff -Nru pasystray-0.6.0/src/pasystray.glade pasystray-0.7.0/src/pasystray.glade --- pasystray-0.6.0/src/pasystray.glade 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pasystray.glade 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ - - - - - - False - 5 - pasystray - dialog - pasystray - Copyright © 2011-2013 - PulseAudio system tray - Christoph Gysin <christoph.gysin@gmail.com> - pasystray - lgpl-2-1 - - - False - vertical - 2 - - - True - True - True - end - - - False - True - end - 0 - - - - - - - - - - False - 5 - Error - False - dialog - error - ok - An error occurred - - - False - - - False - - - False - False - 0 - - - - - - - False - 5 - Rename <device> <name> - normal - - - False - vertical - 2 - - - False - end - - - Cancel - True - False - - - False - True - 0 - - - - - OK - True - False - bottom - - - False - True - 1 - - - - - False - True - end - 0 - - - - - False - Rename <device> <old name> to: - - - False - True - 0 - - - - - True - True - True - True - True - - True - - - False - True - 4 - - - - - - cancelbutton - okbutton - - - diff -Nru pasystray-0.6.0/src/pasystray.gtk2.glade pasystray-0.7.0/src/pasystray.gtk2.glade --- pasystray-0.6.0/src/pasystray.gtk2.glade 1970-01-01 00:00:00.000000000 +0000 +++ pasystray-0.7.0/src/pasystray.gtk2.glade 2018-09-28 15:20:16.000000000 +0000 @@ -0,0 +1,138 @@ + + + + + + False + 5 + pasystray + dialog + pasystray + Copyright © 2011-2016 + PulseAudio system tray + Christoph Gysin <christoph.gysin@gmail.com> + pasystray + + + False + + + True + + + False + True + 0 + + + + + + + False + 5 + Error + False + dialog + error + ok + An error occurred + + + False + + + False + + + False + False + 0 + + + + + + + False + 5 + Rename <device> <name> + normal + + + False + + + False + + + gtk-cancel + True + True + False + True + + + False + True + 0 + + + + + gtk-ok + True + True + True + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + Rename <device> <old name> to: + + + False + True + 0 + + + + + True + True + + False + False + True + True + + + False + True + 4 + + + + + + cancelbutton + okbutton + + + diff -Nru pasystray-0.6.0/src/pasystray.gtk3.glade pasystray-0.7.0/src/pasystray.gtk3.glade --- pasystray-0.6.0/src/pasystray.gtk3.glade 1970-01-01 00:00:00.000000000 +0000 +++ pasystray-0.7.0/src/pasystray.gtk3.glade 2018-09-28 15:20:16.000000000 +0000 @@ -0,0 +1,147 @@ + + + + + + False + 5 + pasystray + dialog + pasystray + Copyright © 2011-2016 + PulseAudio system tray + Christoph Gysin <christoph.gysin@gmail.com> + pasystray + lgpl-2-1 + + + False + vertical + 2 + + + True + True + True + end + + + False + True + end + 0 + + + + + + + + + + False + 5 + Error + False + dialog + error + ok + An error occurred + + + False + + + False + + + False + False + 0 + + + + + + + False + 5 + Rename <device> <name> + normal + + + False + vertical + 2 + + + False + end + + + Cancel + True + False + + + False + True + 0 + + + + + OK + True + False + bottom + + + False + True + 1 + + + + + False + True + end + 0 + + + + + False + Rename <device> <old name> to: + + + False + True + 0 + + + + + True + True + True + True + True + + True + + + False + True + 4 + + + + + + cancelbutton + okbutton + + + diff -Nru pasystray-0.6.0/src/pasystray.h pasystray-0.7.0/src/pasystray.h --- pasystray-0.6.0/src/pasystray.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pasystray.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/pulseaudio_action.c pasystray-0.7.0/src/pulseaudio_action.c --- pasystray-0.6.0/src/pulseaudio_action.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio_action.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -118,13 +118,17 @@ void pulseaudio_move_success_cb(pa_context *c, int success, void *userdata) { - menu_info_item_t* to = userdata; - menu_info_item_t* from = to->menu_info->parent; + menu_info_item_t* mii = userdata; if(!success) - g_warning("failed to move %s '%s' to %s '%s'!\n", - menu_info_type_name(from->menu_info->type), from->name, - menu_info_type_name(to->menu_info->type), to->name); + { + g_warning("failed to move %s '%s'!\n", + menu_info_type_name(mii->menu_info->type), mii->desc); + + menu_info_t* mi = mii->menu_info; + menu_info_item_update(mi, mii->index, mii->name, mii->desc, mii->volume, + mii->mute, NULL, mii->icon, mii->address, mii->target); + } } void pulseaudio_rename(menu_info_item_t* mii, const char* name) @@ -217,12 +221,43 @@ if(mii->menu_info->type == MENU_SINK || mii->menu_info->type == MENU_SOURCE) ui_set_volume_icon(mii); - if(mis->settings.notify != NOTIFY_NEVER) + if(mis->settings.n_systray_action) { pulseaudio_update_volume_notification(mii); } } +void pulseaudio_process_update_volume_notification(menu_info_item_t* mii) +{ + menu_infos_t* mis = mii->menu_info->menu_infos; + menu_info_t* mi = mii->menu_info; + + switch(mi->type) + { + case MENU_SERVER: + case MENU_MODULE: + case MENU_INPUT: + case MENU_OUTPUT: + break; + + case MENU_SINK: + if(mis->settings.n_sink) + break; + if(mis->settings.n_sink_default && g_str_equal(mii->name, mi->default_name)) + break; + return; + + case MENU_SOURCE: + if(mis->settings.n_source) + break; + if(mis->settings.n_source_default && g_str_equal(mii->name, mi->default_name)) + break; + return; + } + + pulseaudio_update_volume_notification(mii); +} + void pulseaudio_update_volume_notification(menu_info_item_t* mii) { gchar* label = menu_info_item_label(mii); @@ -312,3 +347,8 @@ if(!success) g_warning("failed to unload module %s!\n", mii->name); } + +void pulseaudio_terminate(void) +{ + pa_operation_unref(pa_context_exit_daemon(context, NULL, NULL)); +} diff -Nru pasystray-0.6.0/src/pulseaudio_action.h pasystray-0.7.0/src/pulseaudio_action.h --- pasystray-0.6.0/src/pulseaudio_action.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio_action.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -38,6 +38,7 @@ void pulseaudio_volume(menu_info_item_t* mii, int inc); void pulseaudio_set_volume_success_cb(pa_context *c, int success, void *userdata); +void pulseaudio_process_update_volume_notification(menu_info_item_t* mii); void pulseaudio_update_volume_notification(menu_info_item_t* mii); void pulseaudio_toggle_mute(menu_info_item_t* mii); @@ -49,4 +50,6 @@ void pulseaudio_module_unload(menu_info_item_t* mii); void pulseaudio_module_unload_success_cb(pa_context *c, int success, void *userdata); +void pulseaudio_terminate(void); + #endif /* PASYSTRAY_PULSEAUDIO_ACTION_H */ diff -Nru pasystray-0.6.0/src/pulseaudio.c pasystray-0.7.0/src/pulseaudio.c --- pasystray-0.6.0/src/pulseaudio.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -102,14 +102,21 @@ case PA_CONTEXT_READY: { - char* tooltip = context_info_str(context); - char* escaped = g_markup_escape_text(tooltip, -1); - char* markup = g_strdup_printf( + if(mis->settings.icon_tooltip) + { + char* tooltip = context_info_str(context); + char* escaped = g_markup_escape_text(tooltip, -1); + char* markup = g_strdup_printf( "%s", escaped); - systray_impl_set_tooltip(mis->systray, markup); - g_free(escaped); - g_free(tooltip); - g_free(markup); + systray_impl_set_tooltip(mis->systray, markup); + g_free(escaped); + g_free(tooltip); + g_free(markup); + } + else + { + systray_impl_set_has_tooltip(mis->systray, FALSE); + } pa_context_set_subscribe_callback(context, pulseaudio_event_cb, mis); pa_operation_unref(pa_context_subscribe(context, @@ -378,9 +385,9 @@ menu_info_t* mi = userdata; menu_infos_t* mis = mi->menu_infos; - if(is_new && mis->settings.notify != NOTIFY_NEVER) + if(is_new && mis->settings.n_new) { - gchar* msg = g_strdup_printf("new sink \"%s\"", i->description); + gchar* msg = g_strdup_printf("New sink \"%s\"", i->description); notify(msg, i->name, NULL, -1); g_free(msg); } @@ -426,9 +433,9 @@ if(!mis->settings.monitors && class && g_str_equal(class, "monitor")) return; - if(is_new && mis->settings.notify != NOTIFY_NEVER) + if(is_new && mis->settings.n_new) { - gchar* msg = g_strdup_printf("new source \"%s\"", i->description); + gchar* msg = g_strdup_printf("New source \"%s\"", i->description); notify(msg, i->name, NULL, -1); g_free(msg); } diff -Nru pasystray-0.6.0/src/pulseaudio.h pasystray-0.7.0/src/pulseaudio.h --- pasystray-0.6.0/src/pulseaudio.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/pulseaudio_info.c pasystray-0.7.0/src/pulseaudio_info.c --- pasystray-0.6.0/src/pulseaudio_info.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio_info.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/pulseaudio_info.h pasystray-0.7.0/src/pulseaudio_info.h --- pasystray-0.6.0/src/pulseaudio_info.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/pulseaudio_info.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/systray.c pasystray-0.7.0/src/systray.c --- pasystray-0.6.0/src/systray.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/systray.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -64,6 +64,13 @@ */ systray_menu_add_separator(mis->menu); + + GtkMenuShell* submenu = GTK_MENU_SHELL(gtk_menu_new()); + GtkWidget* item = systray_add_item(mis->menu, "More...", NULL, NULL); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), GTK_WIDGET(submenu)); + systray_menu_add_action(submenu, "Terminate server", "process-stop", + G_CALLBACK(pulseaudio_terminate)); + systray_menu_add_action(mis->menu, "About", "help-about", G_CALLBACK(systray_about_dialog)); systray_menu_add_action(mis->menu, "Quit", "application-exit", G_CALLBACK(quit)); } @@ -137,8 +144,10 @@ if(g_hash_table_size(mi->items) == 0) { GList* children = gtk_container_get_children(GTK_CONTAINER(mi->menu)); - if(children) + if(children) { gtk_container_remove(GTK_CONTAINER(mi->menu), GTK_WIDGET(children->data)); + g_list_free(children); + } } } @@ -185,10 +194,12 @@ /* update group */ GList* children = gtk_container_get_children(GTK_CONTAINER(mi->menu)); - if(children) + if(children) { mi->group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(children->data)); - else + g_list_free(children); + } else { mi->group = NULL; + } } GtkWidget* systray_add_item(GtkMenuShell* menu, const char* desc, const char* tooltip, const char* icon) diff -Nru pasystray-0.6.0/src/systray.h pasystray-0.7.0/src/systray.h --- pasystray-0.6.0/src/systray.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/systray.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/systray_impl.c pasystray-0.7.0/src/systray_impl.c --- pasystray-0.6.0/src/systray_impl.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/systray_impl.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -57,6 +57,11 @@ { // TODO: set tooltip? } + +void systray_impl_set_has_tooltip(systray_t systray, gboolean has_tooltip) +{ + // TODO: enable/disable tooltip? +} #elif HAVE_STATUSICON #include "ui.h" @@ -151,6 +156,12 @@ gtk_status_icon_set_tooltip_markup(icon, markup); } +void systray_impl_set_has_tooltip(systray_t systray, gboolean has_tooltip) +{ + GtkStatusIcon* icon = systray; + gtk_status_icon_set_has_tooltip(icon, has_tooltip); +} + #else static void systray_impl_scroll_cb(GtkImage* image, GdkEventScroll* ev, gpointer userdata) @@ -194,4 +205,10 @@ gtk_widget_set_tooltip_markup(GTK_WIDGET(image), markup); } +void systray_impl_set_has_tooltip(systray_t systray, gboolean has_tooltip) +{ + GtkImage *image = systray; + gtk_widget_set_has_tooltip(GTK_WIDGET(image), has_tooltip); +} + #endif diff -Nru pasystray-0.6.0/src/systray_impl.h pasystray-0.7.0/src/systray_impl.h --- pasystray-0.6.0/src/systray_impl.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/systray_impl.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,5 +27,6 @@ systray_t systray_impl_create(menu_infos_t* mis); void systray_impl_set_icon(systray_t systray, const char* icon_name); void systray_impl_set_tooltip(systray_t systray, const char* markup); +void systray_impl_set_has_tooltip(systray_t systray, gboolean has_tooltip); #endif /* PASYSTRAY_SYSTRAY_IMPL_H */ diff -Nru pasystray-0.6.0/src/ui.c pasystray-0.7.0/src/ui.c --- pasystray-0.6.0/src/ui.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/ui.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ USA. ***/ +#include #include "ui.h" #include "config.h" #include "systray_impl.h" @@ -35,17 +36,20 @@ const char* filename = GLADE_FILE; /* try to load ui in current dir first */ - char* local_file = "pasystray.glade"; - if(g_file_test(local_file, G_FILE_TEST_EXISTS)) - filename = local_file; - local_file = "src/pasystray.glade"; + gchar* local_file = g_strdup_printf("pasystray.gtk%u.glade", GTK_VERSION_MAJOR); if(g_file_test(local_file, G_FILE_TEST_EXISTS)) filename = local_file; + gchar* local_file_src = g_strdup_printf("src/pasystray.gtk%u.glade", GTK_VERSION_MAJOR); + if(g_file_test(local_file_src, G_FILE_TEST_EXISTS)) + filename = local_file_src; g_debug("using UI file: %s", filename); guint ret = gtk_builder_add_from_file(builder, filename, &error); + g_free(local_file); + g_free(local_file_src); + if(!ret) { g_error("[ui] %s", error->message); diff -Nru pasystray-0.6.0/src/ui.h pasystray-0.7.0/src/ui.h --- pasystray-0.6.0/src/ui.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/ui.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/x11-property.c pasystray-0.7.0/src/x11-property.c --- pasystray-0.6.0/src/x11-property.c 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/x11-property.c 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/src/x11-property.h pasystray-0.7.0/src/x11-property.h --- pasystray-0.6.0/src/x11-property.h 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/src/x11-property.h 2018-09-28 15:20:16.000000000 +0000 @@ -1,7 +1,7 @@ /*** This file is part of PaSystray - Copyright (C) 2011-2015 Christoph Gysin + Copyright (C) 2011-2016 Christoph Gysin PaSystray is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff -Nru pasystray-0.6.0/.travis.yml pasystray-0.7.0/.travis.yml --- pasystray-0.6.0/.travis.yml 2016-07-17 10:41:33.000000000 +0000 +++ pasystray-0.7.0/.travis.yml 2018-09-28 15:20:16.000000000 +0000 @@ -15,6 +15,11 @@ env: - CFLAGS=--std=c99 - CFLAGS=--std=c99 EXTRA_CONF=--with-gtk=2 + - CFLAGS=--std=c99 EXTRA_CONF=--disable-avahi + - CFLAGS=--std=c99 EXTRA_CONF=--disable-notify + - CFLAGS=--std=c99 EXTRA_CONF=--disable-x11 + - CFLAGS=--std=c99 EXTRA_CONF=--disable-statusicon + - CFLAGS=--std=c99 EXTRA_CONF=--disable-appindicator - USE_CC=gcc-4.9 CFLAGS=--std=c99 - USE_CC=gcc-4.9 CFLAGS=--std=c11 - USE_CC=clang-3.7 CFLAGS=--std=c99