Backport !4140 to 5.27
A closed window cannot be activated, so guard relevant code paths to ensure that we don't hit this unexpected case.
CCBUG: 438315 (cherry picked from commit 07a6b500)
A closed window cannot be activated, so guard relevant code paths to ensure that we don't hit this unexpected case.
CCBUG: 438315 (cherry picked from commit 07a6b500)