Skip to content

Commit

Permalink
pulse: Specify properties for application ID and icon name
Browse files Browse the repository at this point in the history
This allows Pavucontrol for example to display the
Audacious icon instead of a general fallback icon.
  • Loading branch information
radioactiveman committed Sep 20, 2024
1 parent ebcad66 commit a3f3917
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ dnl $2 = long name of plugin (e.g. PulseAudio output plugin)
dnl $3 = enabled by default (auto/yes/no)
dnl $4 = type of plugin (e.g. OUTPUT)
dnl $5 = CFLAGS/LIBS prefix (e.g. PULSE)
dnl $6 = dependency (e.g. libpulse >= 0.9.5)
dnl $6 = dependency (e.g. libpulse >= 0.9.11)

AC_DEFUN([ENABLE_PLUGIN_WITH_DEP], [
AC_ARG_ENABLE($1,
Expand Down Expand Up @@ -397,7 +397,7 @@ ENABLE_PLUGIN_WITH_DEP(pulse,
auto,
OUTPUT,
PULSE,
libpulse >= 0.9.5)
libpulse >= 0.9.11)

test_sndio () {
PKG_CHECK_MODULES(SNDIO, sndio >= 1.9, [
Expand Down
4 changes: 2 additions & 2 deletions src/pulse/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pulse_dep = dependency('libpulse', version: '>= 0.9.5', required: false)
pulse_dep = dependency('libpulse', version: '>= 0.9.11', required: false)
have_pulse = pulse_dep.found()


if have_pulse
shared_module('pulse_audio',
'pulse_audio.cc',
dependencies: [audacious_dep, pulse_dep, glib_dep],
dependencies: [audacious_dep, pulse_dep],
name_prefix: '',
install: true,
install_dir: output_plugin_dir
Expand Down
11 changes: 10 additions & 1 deletion src/pulse/pulse_audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,16 @@ static bool create_context (aud::mutex::holder & lock)
return false;
}

if (! (context = pa_context_new (pa_mainloop_get_api (mainloop), get_context_name ())))
pa_proplist * proplist = pa_proplist_new ();
pa_proplist_sets (proplist, PA_PROP_APPLICATION_ID, "audacious");
pa_proplist_sets (proplist, PA_PROP_APPLICATION_ICON_NAME, "audacious");

context = pa_context_new_with_proplist (pa_mainloop_get_api (mainloop),
get_context_name (), proplist);

pa_proplist_free (proplist);

if (! context)
{
AUDERR ("Failed to allocate context\n");
return false;
Expand Down

0 comments on commit a3f3917

Please sign in to comment.