From f2bbd301f294eaea6755421ff87830cfc1af78b9 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 12 Nov 2016 09:40:14 +0100 Subject: [PATCH] feat(xbacklight): Change value on scroll - Add action handlers for scroll up/down (conf: enable-sroll = true) - Use xcb_timestamps instead of the throttle util --- include/common.hpp | 1 + include/modules/xbacklight.hpp | 13 ++++- include/x11/graphics.hpp | 8 ++- include/x11/randr.hpp | 1 + src/components/eventloop.cpp | 2 +- src/modules/xbacklight.cpp | 99 +++++++++++++++++++++++++------ src/x11/graphics.cpp | 103 ++++++++++++++++++++++----------- src/x11/randr.cpp | 27 +++++---- 8 files changed, 184 insertions(+), 70 deletions(-) diff --git a/include/common.hpp b/include/common.hpp index e726a9db..b3153e95 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -68,6 +68,7 @@ using std::to_string; using std::strerror; using std::getenv; using std::thread; +using std::exception; using boost::optional; diff --git a/include/modules/xbacklight.hpp b/include/modules/xbacklight.hpp index 12e00fa2..bc51d640 100644 --- a/include/modules/xbacklight.hpp +++ b/include/modules/xbacklight.hpp @@ -9,7 +9,6 @@ #include "drawtypes/progressbar.hpp" #include "drawtypes/ramp.hpp" #include "modules/meta.hpp" -#include "utils/throttle.hpp" LEMONBUDDY_NS @@ -35,21 +34,31 @@ namespace modules { void setup(); void handle(const evt::randr_notify& evt); void update(); + string get_output(); bool build(builder* builder, string tag) const; + bool handle_event(string cmd); + bool receive_events() const { + return true; + } private: static constexpr auto TAG_LABEL = "