So for quite a while I was having this problem with my iTunes.
I am running iTunes 11 (not sure on the exact version) and every time I right click a song, or group of songs to edit the information, after a few seconds the window loses focus. So this means you can be staring at your keyboard typing the song name and the window will lose focus causing your typing to stop.
I ended up having to wait until it happened and then clicking back on the window so it would go back into focus.
It was driving me bloody insane for ages until I decided to sit down and fix it. A few Google searches proved unhelpful, so I tried a few different things.
I opened up Task Manager and opened the Performance tab. I noticed that when I opened the "Get Info" window, my CPU usage would suddenly spike to 10/11% and then go back to 0/1/2% that my CPU normally runs on. I thought maybe a background application was stealing focus.
I set the priority of iTunes to High but it didn't solve anything.
So I conducted a quick Google search querying X11 and iTunes which brought me to a strange forum who were explaining that MSN and one of its clients Mercury interact with iTunes to send and receive song information. If you are an MSN user then you probably know about the "Show information about the song I am listening to" feature. So iTunes, MSN and Mercury communicate with each other regarding song information which seems to be the reason my CPU spikes.
So basically, to solve this problem, turn the "Show information about the song I am listening to" feature off. Yes, that's it!
A very strange bug that Apple hasn't seemed to pick up on but it turns out to be a simple fix.
Remember, you can leave the aforementioned feature turned on if you want people to see what you are listening to as it doesn't disrupt iTunes' performance in any other way. Just turn it off if you are going to edit a song(s)' information.