Birds fly into windows for several reasons. If a bird is flying slowly it is probably reacting to its reflection in the glass and wants to chase the "invader" out of its territory. If it is flying fast, injuring or killing itself, it is not able to see the glass and is attempting to fly through the window.
To stop this behavior you must eliminate the reflection. Mix up a solution of soapy or salty water and spray this on your window using a plant mister. Allow the water to dry, leaving a film on the window. Repeat after it rains, and continue as needed or until breeding season is over. You may also try placing the silhouette of a bird in the window.
Still another possibility is to close the blinds or curtains during the day, or cover the outside of the glass with a screen, cloth, or paper for approximately one week.