diff options
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 */ |
