Add window type to If as well

This one required some extra helpers so is separate commit