wrap around right for focus cycling
This commit is contained in:
parent
d4e4e25e28
commit
104c1a164b
1 changed files with 3 additions and 2 deletions
|
@ -59,10 +59,11 @@ def focus_next(data, num=1, forward=1):
|
||||||
for i in r:
|
for i in r:
|
||||||
if found:
|
if found:
|
||||||
target = i
|
target = i
|
||||||
|
found = 2
|
||||||
break
|
break
|
||||||
elif screen.client(i).window() == client_win:
|
elif screen.client(i).window() == client_win:
|
||||||
found = 1
|
found = 1
|
||||||
if not found: # wraparound
|
if found == 1: # wraparound
|
||||||
if forward: target = 0
|
if forward: target = 0
|
||||||
else: target = count - 1
|
else: target = count - 1
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ def focus_next(data, num=1, forward=1):
|
||||||
t += num
|
t += num
|
||||||
if t >= count: t -= count
|
if t >= count: t -= count
|
||||||
else:
|
else:
|
||||||
t -= 1
|
t -= num
|
||||||
if t < 0: t += count
|
if t < 0: t += count
|
||||||
if t == target: return # nothing to focus
|
if t == target: return # nothing to focus
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue