If you want to create the best ever fence, then you need to get into the mindset of the animal. Animals won’t see a window or a fence as a barrier. It may see it as an invitation to go over or under it and we need to create barriers they can understand.
In Africa, for example, farmers use bee hives to scare elephants away, or if we want to keep wolves away from our sheep then we can use urine and feces from other packs.
Learning what keeps animals away from our grounds will help us create better barriers and protect us better. These types of barriers have the advantage that they will keep the pests away while leaving other animals alone. Smart barriers, biological barriers.