Skip to content

Commit

Permalink
fix(workspace): scroll direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Mar 25, 2019
1 parent 98c0282 commit 5144426
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/sway/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 5144426

Please sign in to comment.