Álvaro Ramírez has a new Emacs app available. The app, winpulse, is his answer to keeping track of the active window. What happens is that every time the focus changes the new window flashes so you get a visual indication of the new window.
I had the same problem but solved it in a different way. I made the modeline of the active window a strikingly different color so that it’s easy to spot the one with focus. I like my solution better because the indication has longevity. If I get up and then return to my computer, I can immediately see which window is active. The nice thing about my solution is that it simply amounts to a set-face-attribute as you can see in my post or below.
None of this will come as news to Ramírez, of course. He simply prefers a different way of indicating the active window and, as always, Emacs makes it easy to have it your way.
Ramírez says the the app is brand new so it won’t be on Melpa yet but you can get it from its GitHup repository. If you like just having a momentary indication of the active window, Ramírez’s solution may be just what you’re looking for. If you prefer something a little stickier, changing the color of the modeline has worked very well for me. You could, I suppose even use both methods.
For the record, here’s the current code from my inet.el:
(set-face-attribute 'mode-line-active nil :foreground "black" :background "goldenrod" :box '(:line-width 1 :color "black"))
Unless you have a tan background, goldenrod probably isn’t the right color for you but you can experiment to see what works well with your theme.