fix(idle_inhibitor): overload

This commit is contained in:
Alex 2019-05-02 17:51:01 +02:00
parent 5623bbecfe
commit 1a024db03c
2 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#include "ALabel.hpp" #include "ALabel.hpp"
#include <util/command.hpp>
#include <fmt/format.h> #include <fmt/format.h>
#include <util/command.hpp>
waybar::ALabel::ALabel(const Json::Value& config, const std::string& format, uint16_t interval) waybar::ALabel::ALabel(const Json::Value& config, const std::string& format, uint16_t interval)
: config_(config), : config_(config),
@ -26,7 +26,9 @@ waybar::ALabel::ALabel(const Json::Value& config, const std::string& format, uin
} }
// configure events' user commands // configure events' user commands
if (config_["on-click"].isString() || config_["on-click-right"].isString()) { if (config_["on-click"].isString() || config_["on-click-middle"].isString() ||
config_["on-click-backward"].isString() || config_["on-click-forward"].isString() ||
config_["on-click-right"].isString()) {
event_box_.add_events(Gdk::BUTTON_PRESS_MASK); event_box_.add_events(Gdk::BUTTON_PRESS_MASK);
event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &ALabel::handleToggle)); event_box_.signal_button_press_event().connect(sigc::mem_fun(*this, &ALabel::handleToggle));
} }
@ -75,7 +77,7 @@ bool waybar::ALabel::handleToggle(GdkEventButton* const& e) {
} }
dp.emit(); dp.emit();
return false; return true;
} }
bool waybar::ALabel::handleScroll(GdkEventScroll* e) { bool waybar::ALabel::handleScroll(GdkEventScroll* e) {

View File

@ -51,10 +51,7 @@ bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) {
status_ = "activated"; status_ = "activated";
} }
click_param = status_; click_param = status_;
} else { }
ALabel::handleToggle(e); ALabel::handleToggle(e);
} return true;
dp.emit();
return false;
} }