Skip to content
This repository was archived by the owner on Mar 12, 2022. It is now read-only.

Commit 92549b4

Browse files
committed
ignore windows without id
1 parent e90c7f3 commit 92549b4

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Diff for: init.lua

+12-7
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ module.removeSpace = function(...)
292292
_BE_DANGEROUS_FLAG_ = _Are_We_Being_Dangerous_
293293
-- check for windows which need to be moved
294294
local theWindows = {}
295-
for i, v in ipairs(module.allWindowsForSpace(spaceID)) do table.insert(theWindows, v:id()) end
295+
for i, v in ipairs(module.allWindowsForSpace(spaceID)) do if v:id() then table.insert(theWindows, v:id()) end end
296296

297297
-- get id of screen to move them to
298298
local baseID = 0
@@ -368,9 +368,11 @@ module.allWindowsForSpace = function(...)
368368
end
369369
local realWindowIDs = {}
370370
for i,v in ipairs(windowIDs) do
371-
for j,k in ipairs(internal.windowsOnSpaces(v:id())) do
372-
if k == spaceID then
373-
table.insert(realWindowIDs, v)
371+
if v:id() then
372+
for j,k in ipairs(internal.windowsOnSpaces(v:id())) do
373+
if k == spaceID then
374+
table.insert(realWindowIDs, v)
375+
end
374376
end
375377
end
376378
end
@@ -519,10 +521,13 @@ screenMT.__index.spaces = function(obj) return module.spacesByScreenUUI
519521
screenMT.__index.spacesUUID = internal.UUIDforScreen
520522
screenMT.__index.spacesAnimating = function(obj) return internal.screenUUIDisAnimating(internal.UUIDforScreen(obj)) end
521523

522-
windowMT.__index.spaces = function(obj) return internal.windowsOnSpaces(obj:id()) end
524+
windowMT.__index.spaces = function(obj) return obj:id() and internal.windowsOnSpaces(obj:id()) or nil end
523525
windowMT.__index.spacesMoveTo = function(obj, ...)
524-
module.moveWindowToSpace(obj:id(), ...)
525-
return obj
526+
if obj:id() then
527+
module.moveWindowToSpace(obj:id(), ...)
528+
return obj
529+
end
530+
return nil
526531
end
527532

528533
-- add raw subtable if the user has enabled it

0 commit comments

Comments
 (0)