Wrong app is focused when quitting another one? I have Firefox and the Finder open (neither are hidden), with PDF files in the current Finder window. If I open one of the PDF files, it opens in Preview. When I quit Preview, rather than Finder being focused, Firefox is focused instead.

This did NOT used to be the case in previous versions of OS X. There is an order in which apps are focused, and that is whatever was last focused. So, when quitting the PDF file, the Finder should have been focused. This has occurred since I upgraded to Mavericks.

Anyone know how to fix this, or if it is indeed a bug? This happens with Firefox and the Finder, most frequently.
Just asked the same question and saw yours after…
It's actualy not related to Finder/PDF/Preview:

I had the issue with a first Mac (iMac): every time an app was quit (auto or by me), MAMP software (that I always let hidden) was reactivated. I thought it was a MAMP bug, but I just updated to Mavericks on another Mac (MBP – yes, I'm a bit late), and exactly the same thing is happening with Firefox (I have MAMP installed on it too).

So I just think this is a Mavericks bug…
https://developer.apple.com/bug-reporting/ !