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

Commit fdb7aaf

Browse files
committed
protect against removing window when moving to same space
1 parent 0f23a4d commit fdb7aaf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: init.lua

+4-3
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,10 @@ module.moveWindowToSpace = function(...)
402402
elseif #currentSpaces > 1 then
403403
error("moveWindowToSpace:window on multiple spaces", 2)
404404
end
405-
406-
internal.windowsAddTo(windowID, spaceID)
407-
internal.windowsRemoveFrom(windowID, currentSpaces[1])
405+
if currentSpaces[1] ~= spaceID then
406+
internal.windowsAddTo(windowID, spaceID)
407+
internal.windowsRemoveFrom(windowID, currentSpaces[1])
408+
end
408409
return internal.windowsOnSpaces(windowID)[1]
409410
else
410411
error("moveWindowToSpace:invalid argument, windowID and spaceID expected", 2)

0 commit comments

Comments
 (0)