From 3ea60ace912a219a5ff017f50e22673781acdd57 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Tue, 27 Mar 2018 09:52:31 +0200 Subject: [PATCH] fix(pulse): Use distinct event names volup, voldow, volmute, are caught by the alsa module, if there is an alsa module on the bar. --- include/modules/pulseaudio.hpp | 8 ++++---- src/modules/pulseaudio.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/modules/pulseaudio.hpp b/include/modules/pulseaudio.hpp index 02331c63..e85dce11 100644 --- a/include/modules/pulseaudio.hpp +++ b/include/modules/pulseaudio.hpp @@ -35,10 +35,10 @@ namespace modules { static constexpr auto TAG_LABEL_VOLUME = ""; static constexpr auto TAG_LABEL_MUTED = ""; - static constexpr auto EVENT_PREFIX = "vol"; - static constexpr auto EVENT_VOLUME_UP = "volup"; - static constexpr auto EVENT_VOLUME_DOWN = "voldown"; - static constexpr auto EVENT_TOGGLE_MUTE = "volmute"; + static constexpr auto EVENT_PREFIX = "pa_vol"; + static constexpr auto EVENT_VOLUME_UP = "pa_volup"; + static constexpr auto EVENT_VOLUME_DOWN = "pa_voldown"; + static constexpr auto EVENT_TOGGLE_MUTE = "pa_volmute"; progressbar_t m_bar_volume; ramp_t m_ramp_volume; diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index f65523cf..3da153e7 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -126,7 +126,7 @@ namespace modules { bool pulseaudio_module::input(string&& cmd) { if (!m_handle_events) { return false; - } else if (cmd.compare(0, 3, EVENT_PREFIX) != 0) { + } else if (cmd.compare(0, strlen(EVENT_PREFIX), EVENT_PREFIX) != 0) { return false; }