Workspaces: fix twitchy scrolling on touchpads

Previously, any and all scroll events were interpreted as reason to switch
workspaces. This resulted in twitchy behaviour, where the scrolling was
practically unusable.

Now, we pool all scroll values, and only scroll if the value is larger than the
new config option "smooth-scrolling-threshold". If this option is not set, the
behaviour is unchanged.
This commit is contained in:
Patrick Hilhorst
2019-06-11 16:19:11 +02:00
parent 1962caf144
commit ed4521d113
2 changed files with 20 additions and 6 deletions

View File

@ -41,6 +41,7 @@ class Workspaces : public IModule, public sigc::trackable {
util::JsonParser parser_;
bool scrolling_;
std::unordered_map<std::string, Gtk::Button> buttons_;
gdouble distance_scrolled_;
util::SleeperThread thread_;
Ipc ipc_;