Made Window z-indices update when windows are closed (#13174)

Change-Id: I2fa7566ec4788893d1d99440a7ca2d014c9a8f13
Merge remote-tracking branch 'origin/7.1'

Change-Id: I17fa1bf6982c8c7e1f9faf26b77593b170fa5fdd