Possible bugfix where windows aren't shown in correct order.

The cached visibility status is used now instead of calling
`IsVisible()` again.