diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-23 23:18:05 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-23 23:18:05 +0000 |
| commit | 104c1a164b1e4e881e141d14263895401779d453 (patch) | |
| tree | e7e58f7d4841685977e8ed1e2cb7dfaf4043c022 /scripts/focus.py | |
| parent | d4e4e25e2841d3aefc5dc13bab551d77b63590ea (diff) | |
wrap around right for focus cycling
Diffstat (limited to 'scripts/focus.py')
| -rw-r--r-- | scripts/focus.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/focus.py b/scripts/focus.py index 4c3e5a13..79da5a21 100644 --- a/scripts/focus.py +++ b/scripts/focus.py @@ -59,10 +59,11 @@ def focus_next(data, num=1, forward=1): for i in r: if found: target = i + found = 2 break elif screen.client(i).window() == client_win: found = 1 - if not found: # wraparound + if found == 1: # wraparound if forward: target = 0 else: target = count - 1 @@ -80,7 +81,7 @@ def focus_next(data, num=1, forward=1): t += num if t >= count: t -= count else: - t -= 1 + t -= num if t < 0: t += count if t == target: return # nothing to focus |
