Skip to content

Commit

Permalink
fix(Pulseaudio): avoid handleScroll override
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed May 13, 2019
1 parent 92967c7 commit 4f1defe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/modules/pulseaudio.hpp
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/modules/pulseaudio.cpp
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4f1defe

Please sign in to comment.