summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-04 12:10:19 +0000
committerDana Jansens <danakj@orodu.net>2003-02-04 12:10:19 +0000
commit7d66a2a42b97938a4c4d925abf0ec0d3d4976d95 (patch)
tree0e1346da94efd3c25fc41528f29162a3237a8490
parentcb5eb0d560759cebce3279cb28d942166e0e9a7a (diff)
add some safety checks
-rw-r--r--scripts/focus.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/focus.py b/scripts/focus.py
index 5e7c0d28..f51b9214 100644
--- a/scripts/focus.py
+++ b/scripts/focus.py
@@ -53,7 +53,9 @@ def _focused(data):
if data.client:
# move it to the top
- _remove(data.client)
+ try:
+ _remove(data.client)
+ except ValueError: pass # happens if _focused comes before _newwindow
_clients.insert(0, data.client)
elif FALLBACK:
# pass around focus
@@ -63,6 +65,11 @@ def _focused(data):
break
def _newwindow(data):
+ # make sure its not already in the list
+ win = client.window()
+ for i in range(len(_clients)):
+ if _clients[i].window() == win:
+ return
_clients.append(data.client)
def _closewindow(data):