bugfix: don’t send workspace command when at beginning/end of workspaces (Thanks whitequark)
fixes #843
This commit is contained in:
parent
34a5bbb7e9
commit
b9885ff21e
|
@ -302,16 +302,24 @@ void handle_button(xcb_button_press_event_t *event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
/* Mouse wheel down. We select the next ws */
|
/* Mouse wheel up. We select the previous ws, if any.
|
||||||
if (cur_ws != TAILQ_FIRST(walk->workspaces)) {
|
* If there is no more workspace, don’t even send the workspace
|
||||||
|
* command, otherwise (with workspace auto_back_and_forth) we’d end
|
||||||
|
* up on the wrong workspace. */
|
||||||
|
if (cur_ws == TAILQ_FIRST(walk->workspaces))
|
||||||
|
return;
|
||||||
|
|
||||||
cur_ws = TAILQ_PREV(cur_ws, ws_head, tailq);
|
cur_ws = TAILQ_PREV(cur_ws, ws_head, tailq);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
/* Mouse wheel up. We select the previos ws */
|
/* Mouse wheel down. We select the next ws, if any.
|
||||||
if (cur_ws != TAILQ_LAST(walk->workspaces, ws_head)) {
|
* If there is no more workspace, don’t even send the workspace
|
||||||
|
* command, otherwise (with workspace auto_back_and_forth) we’d end
|
||||||
|
* up on the wrong workspace. */
|
||||||
|
if (cur_ws == TAILQ_LAST(walk->workspaces, ws_head))
|
||||||
|
return;
|
||||||
|
|
||||||
cur_ws = TAILQ_NEXT(cur_ws, tailq);
|
cur_ws = TAILQ_NEXT(cur_ws, tailq);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue