From 4f1defe6d5b119cc07b5cb081c2d7d450f61faac Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 13 May 2019 11:46:12 +0200 Subject: [PATCH] fix(Pulseaudio): avoid handleScroll override --- include/modules/pulseaudio.hpp | 2 +- src/modules/pulseaudio.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/modules/pulseaudio.hpp b/include/modules/pulseaudio.hpp index 92c8c06..7d4b629 100644 --- a/include/modules/pulseaudio.hpp +++ b/include/modules/pulseaudio.hpp @@ -20,7 +20,7 @@ class Pulseaudio : public ALabel { static void sinkInfoCb(pa_context*, const pa_sink_info*, int, void*); static void serverInfoCb(pa_context*, const pa_server_info*, void*); static void volumeModifyCb(pa_context*, int, void*); - bool handleScroll(GdkEventScroll* e); + bool handleVolume(GdkEventScroll* e); const std::string getPortIcon() const; diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 9d0fe52..712a2a9 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -39,7 +39,7 @@ waybar::modules::Pulseaudio::Pulseaudio(const std::string &id, const Json::Value // events are configured if (!config["on-scroll-up"].isString() && !config["on-scroll-down"].isString()) { event_box_.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK); - event_box_.signal_scroll_event().connect(sigc::mem_fun(*this, &Pulseaudio::handleScroll)); + event_box_.signal_scroll_event().connect(sigc::mem_fun(*this, &Pulseaudio::handleVolume)); } } @@ -71,7 +71,7 @@ void waybar::modules::Pulseaudio::contextStateCb(pa_context *c, void *data) { } } -bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll *e) { +bool waybar::modules::Pulseaudio::handleVolume(GdkEventScroll *e) { // Avoid concurrent scroll event bool direction_up = false; uint16_t change = config_["scroll-step"].isUInt() ? config_["scroll-step"].asUInt() * 100 : 100;