From 0efe14ff8a00cc73a68a10898609c235ac1f4148 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 5 Nov 2021 09:48:24 +0100 Subject: Restrict com.canonical.settings.sound code to Unity --- src/volume-control-pulse.vala | 14 +++++++++----- src/volume-warning-pulse.vala | 16 +++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index fdb939e..706b0fe 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -520,12 +520,16 @@ public class VolumeControlPulse : VolumeControl this.ready = false; } - /* FIXME: Ubuntu Settings Daemon specifics */ + /* Ubuntu Settings Daemon specifics */ var props = new Proplist (); - props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); - props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); - props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); - props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); + + if (AyatanaCommon.utils_is_unity()) + { + props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); + props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); + props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); + props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); + } reconnect_pulse_dbus (); diff --git a/src/volume-warning-pulse.vala b/src/volume-warning-pulse.vala index 9e7d775..8531c68 100644 --- a/src/volume-warning-pulse.vala +++ b/src/volume-warning-pulse.vala @@ -2,6 +2,7 @@ * -*- Mode:Vala; indent-tabs-mode:t; tab-width:4; encoding:utf8 -*- * * Copyright 2015 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +18,7 @@ * * Authors: * Charles Kerr + * Robert Tari */ using PulseAudio; @@ -195,12 +197,16 @@ public class VolumeWarningPulse : VolumeWarning void pulse_reconnect () { pulse_disconnect (); - /* FIXME: Unity Settings Daemon specifics */ + /* Unity Settings Daemon specifics */ var props = new Proplist (); - props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); - props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); - props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); - props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); + + if (AyatanaCommon.utils_is_unity()) + { + props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); + props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); + props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); + props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); + } _pulse_context = new PulseAudio.Context (_pgloop.get_api(), null, props); _pulse_context.set_state_callback (pulse_context_state_callback); -- cgit v1.2.3