Workspaces: implement horizontal continuous scrolling

This commit is contained in:
Patrick Hilhorst 2019-06-11 18:44:54 +02:00
parent ae397c8fa2
commit 396f7d4525
No known key found for this signature in database
GPG Key ID: 589BB0A8DAFEF2B2

View File

@ -246,7 +246,12 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
case GDK_SCROLL_SMOOTH: { case GDK_SCROLL_SMOOTH: {
gdouble delta_x, delta_y; gdouble delta_x, delta_y;
gdk_event_get_scroll_deltas(reinterpret_cast<const GdkEvent *>(e), &delta_x, &delta_y); gdk_event_get_scroll_deltas(reinterpret_cast<const GdkEvent *>(e), &delta_x, &delta_y);
distance_scrolled_ += delta_y;
if (abs(delta_x) > abs(delta_y)) {
distance_scrolled_ += delta_x;
} else {
distance_scrolled_ += delta_y;
}
gdouble threshold = 0; gdouble threshold = 0;
if (config_["smooth-scrolling-threshold"].isNumeric()) { if (config_["smooth-scrolling-threshold"].isNumeric()) {
threshold = config_["smooth-scrolling-threshold"].asDouble(); threshold = config_["smooth-scrolling-threshold"].asDouble();