OS X give focus to a window after showing I have noticed something that really annoys me.
Say I have some applications running and then I select a particular one using Dock. This application appears on the screen but does not receive focus (windows is displayed as inactive). So, when I type something input is not going to the foremost window.

For more clarification I can say that I always encounter this when focusing Terminal app that is not maximized - window is shown, but no focus on it. Moreover, when I click on an app icon in the Dock and this app was maximized, I have to click twice to see this app.

Have anyone encountered the same?

UPD: the problem relates to switching from full-screen app to non full-screen and vice versa. Switching from one full screen app to another full screen app or from one non-full screen to another non-full screen does not reproduce the problem
Found solution myself. In system settings on the Mission Control tab the second option of the top group must be checked. I don't know exactly how it is in English, it shall be something like 'Switch to space with application windows when switching to an application' or something like that.

I used this as a tip, it says about the third checkbox, but in my case the second one has solved my trouble.