Check if a window is already realized when adding it to a stack