diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-03-01 19:42:56 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-12-16 02:11:13 +0200 |
| commit | 60abc2c323fa0355d6cd52005561e262efc1b23c (patch) | |
| tree | a4dc78a6d322539a7f83d1d6c73de535259c9edd /monsterwm.c | |
| parent | 2cfded4c873ba0ec4401c9c155505c16931f5f06 (diff) | |
rotate non-empty desktops with shortcuts
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/monsterwm.c b/monsterwm.c index 78cb34a..ff1eefb 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -91,6 +91,7 @@ static void next_win(); static void prev_win(); static void quit(const Arg *arg); static void rotate(const Arg *arg); +static void rotate_filled(const Arg *arg); static void spawn(const Arg *arg); static void swap_master(); static void switch_mode(const Arg *arg); @@ -949,6 +950,15 @@ void rotate(const Arg *arg) { } /** + * jump and focus the next non-empty desktop + */ +void rotate_filled(const Arg *arg) { + int n = arg->i; + while (n < DESKTOPS && !desktops[(DESKTOPS + currdeskidx + n) % DESKTOPS].head) (n += arg->i); + change_desktop(&(Arg){.i = (DESKTOPS + currdeskidx + n) % DESKTOPS}); +} + +/** * main event loop * on receival of an event call the appropriate handler */ |
