Though I have not ever purposefully killed a teammate in game, I think its important to differentiate between a couple different versions of the "idiot stands infront of my view/shot dilemma."
A - You are a bit back from the window/view and some idiot blocks your view
B - You are pressed right up against the window and some idiot manages to get infront of you anyway.
C - You are looking down a hallway with an mg and some guy with a bolt (possibly not an idiot in this instance) jumps infront of you AT THE EXACT SAME MOMENT that a bunch of enemy charge around the corner.
In situation A I think its totally inexcusable to kill the friendly. Its possible he just didn't notice you, and since you are not right in the window, his move probably does not put you in any serious danger. In fact, chances are if you are getting a lot of kills in that window, that means he will be dead if he stands there for about 5 seconds. So the enemy will get him anyway.
Situation B is much more frustrating and I can understand the urge to just shoot him in this case, at least if you give him 5 seconds or so to change his mind. Although again, there are different ways to stand "in a window" and these guys tend to stand in the window in the way that gets you killed the quickest. So chances are if you wait 10-15 seconds he'll be dead anyway. But as long as you don't use this as an excuse to plug anyone in the back when you get the urge, I can understand this one.
In situation C, its not so much a question of the guy DESERVING to die, its just that he happens to show up at the exact moment that prevents you from killing about 5 guys. AND they are almost certainly going to kill him anyway at which point you will be very vulnerable. (Especially since in mowing him down, a bullet may very well hit you) I've never given in and just straight up mowed down a friendly in this situation yet but I have opened up the milisecond that I saw blood contact them, though of course at that point you don't know if they are dead dead or just soon to be.
And as for somebody jumping through a window that you are mounted in - yeah that guy probably deserves it. I mean a door is one thing, you expect people to go through doors. It would be physically impossible to pull that window manuever in real life with somebody already standing there - my favorite is when people do it when you are ACTUALLY FIRING one of the mounted heavy LMGs. I mean.....