Males will do that for a period of time around "baby" time. They get extremely protective of their territory. We had one knocking at his image/reflection on a basement window. Was quite annoying.
We have forgiven him, as we now have babies. You can see more here.
Fresh outta the eggs.
They now have feathers, this photo taken right after birth.
Daddy is now busy with feeding, and our quiet has returned, no more pecking on the windows.