]> Dogcows Code - chaz/openbox/commitdiff
wrap around right for focus cycling
authorDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 23:18:05 +0000 (23:18 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 23:18:05 +0000 (23:18 +0000)
scripts/focus.py

index 4c3e5a136db98d8afd25665d27f9a20ec3298d89..79da5a211d0349919c6238771627448787ae89f9 100644 (file)
@@ -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
 
This page took 0.025575 seconds and 4 git commands to generate.