I think he is prob seeing a reflection of himself in the glass and trying to chase away the "other" bird. Either that or a reflection of a tree limb. I've had that happen at my house re the tree limb. I would sugges maybe covering the area of the window for a couple of days, and he should move on. Birds often fly into windows and get concussions or break their necks. It is sad to see.