From 104c1a164b1e4e881e141d14263895401779d453 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 23 Jan 2003 23:18:05 +0000 Subject: [PATCH] wrap around right for focus cycling --- scripts/focus.py | 5 +++-- 1 file 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 -- 2.39.2