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
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):