sminez / penrose

A library for writing an X11 tiling window manager
https://sminez.github.io/penrose/
MIT License
1.23k stars 86 forks source link

Fixes #280 by adding two new methods to StackSet for cycling workspaces #296

Closed sminez closed 3 months ago

sminez commented 3 months ago

Adding two new methods to StackSet: focus_next_workspace and focus_previous_workspace which behave as their name implies. The definition of "next/previous" is in terms of the semantics of the ordered_tags method, so currently in terms of the workspace id. If the semantics of ordered_tags changes in future then so will the behaviour of these methods.

Testing wise there is a simple unit test that the cycling methods focus the expected tag both with and without wrapping at either end of the workspace list, along with a quickcheck test that for arbitrary StackSets with at least two workspaces we always change the focused workspace when calling either method.