Workspaces: implement horizontal continuous scrolling
This commit is contained in:
parent
ae397c8fa2
commit
396f7d4525
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue