fix(workspace): scroll direction

This commit is contained in:
Alex 2019-03-25 11:54:41 +01:00
parent 98c028226d
commit 5144426f0e
1 changed files with 4 additions and 4 deletions

View File

@ -173,19 +173,19 @@ bool waybar::modules::sway::Workspaces::handleScroll(GdkEventScroll *e)
}
std::string name;
if (e->direction == GDK_SCROLL_UP) {
name = getCycleWorkspace(idx, false);
name = getCycleWorkspace(idx, true);
}
if (e->direction == GDK_SCROLL_DOWN) {
name = getCycleWorkspace(idx, true);
name = getCycleWorkspace(idx, false);
}
if (e->direction == GDK_SCROLL_SMOOTH) {
gdouble delta_x, delta_y;
gdk_event_get_scroll_deltas(reinterpret_cast<const GdkEvent *>(e),
&delta_x, &delta_y);
if (delta_y < 0) {
name = getCycleWorkspace(idx, false);
} else if (delta_y > 0) {
name = getCycleWorkspace(idx, true);
} else if (delta_y > 0) {
name = getCycleWorkspace(idx, false);
}
}
if (name.empty() || name == workspaces_[idx]["name"].asString()) {