sway/workspaces: implement reverse-scroll

This commit is contained in:
xb-bx
2025-02-08 19:16:59 +02:00
parent cae5f9a56f
commit 4d74bb3004
2 changed files with 8 additions and 2 deletions

View File

@ -443,10 +443,11 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
if (it == workspaces_.end()) {
return true;
}
bool reverse_scroll = config_["reverse-scroll"].isBool() && config_["reverse-scroll"].asBool();
if (dir == SCROLL_DIR::DOWN || dir == SCROLL_DIR::RIGHT) {
name = getCycleWorkspace(it, false);
name = getCycleWorkspace(it, reverse_scroll ? true : false);
} else if (dir == SCROLL_DIR::UP || dir == SCROLL_DIR::LEFT) {
name = getCycleWorkspace(it, true);
name = getCycleWorkspace(it, reverse_scroll ? false : true);
} else {
return true;
}