Revert "Move CLOSE-WINDOW resource closing to :AFTER method"

This reverts commit 6db90433f6ba4c56695461f763ebe982507f3fd9.