add some safety checks
This commit is contained in:
parent
cb5eb0d560
commit
7d66a2a42b
1 changed files with 8 additions and 1 deletions
|
@ -53,7 +53,9 @@ def _focused(data):
|
||||||
|
|
||||||
if data.client:
|
if data.client:
|
||||||
# move it to the top
|
# 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)
|
_clients.insert(0, data.client)
|
||||||
elif FALLBACK:
|
elif FALLBACK:
|
||||||
# pass around focus
|
# pass around focus
|
||||||
|
@ -63,6 +65,11 @@ def _focused(data):
|
||||||
break
|
break
|
||||||
|
|
||||||
def _newwindow(data):
|
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)
|
_clients.append(data.client)
|
||||||
|
|
||||||
def _closewindow(data):
|
def _closewindow(data):
|
||||||
|
|
Loading…
Reference in a new issue