Prevent invalid client error

This commit is contained in:
Emmanuel Lepage Vallee 2015-03-28 23:49:48 -04:00
parent 03e45b8583
commit eb1a6a1b6c
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,11 @@ end
local function select_screen(scr_index,move,old_screen)
if scr_index ~= old_screen then
local c = last_clients[scr_index]
if c and pcall(c:isvisible()) and c:isvisible() then
if not pcall(c) then
last_clients[scr_index] = nil
c = nil
end
if c and c:isvisible() then
local geom = c:geometry()
if last_clients_coords[scr_index] and last_clients_coords[scr_index].client == c then
capi.mouse.coords(last_clients_coords[scr_index])