Between Mathematica 5.2 and later versions, there has been a change in determining which notebook gets the palette input focus, which leads to quite unfortunate behaviour if you use focus-follows-mouse as I do.
For those who don't know focus-follows-mouse: This mode gives the keyboard input focus to the window which currently contains the mouse pointer. Now consider the following situations: There are two notebooks and a palette open (one of the notebooks might be the help window, which under Mathematica is basically just a notebook). Let's say, the first notebook is on the left, the second one is in the middle, and the palette is on the right. Let's also say that I'm working on the left notebook, and now want to use the palette. Therefore I move the mouse to the palette and press the button I want.
In Mathematica 5.2 this had exactly the intended effect: Mathematica remembered that I last interacted with the left notebook, and inserted the input generated by the palette there. However in Mathematica 8.0 the input is instead inserted in the right notebook.
Of course it's not hard to understand how this happens (and indeed, the problem is not restricted to Mathematica, but occurs also e.g. with Gimp; however the fact that Mathematica 5.2 got it right gives me hope that it's just some option I have to toggle or some initialization I have to edit to regain the behaviour). When I move the mouse pointer from the left notebook to the palette, it of course crosses the right notebook which is in between, and therefore focus-on-mouse gives the keyboard input focus to that window. Of course it loses the input focus again when I move on to the palette (which ultimately gets the input focus), but newer Mathematica versions obviously record which window had input focus last and use that to determine which notebook the palette should act on.
Therefore my question is: Is there some option I can set to recover the old Mathematica-5.2 behaviour? Or if not, is there a way to get it with some Mathematica programming (which I then could put into an init file)?
As I said in a comment to an answer that was deleted in the mean time, I've found out that Mathematica 7 still behaves in the way I want. So the change was obviously introduced in between 7 and 8. I'm adding that here so that the information is visible to those who cannot see deleted answers (and in case the deleted answer including comments might eventually go away completely).
Also note that (as I also wrote in that comment)
SelectedNotebook changes the same way (i.e. follows focus unconditionally in version 8, but changes only on interaction in v7).