On my mac (Sierra, OS 10.12.6), I have it set so that I can swipe between different desktop screens with four fingers on the trackpad. But when I do this, the "control" stays with the app that was in use on the previous screen.
I.e., if I am using the Messages app, but then four-finger swipe to change to the screen where Google Chrome is open, and then I start typing, the text is entered into a conversation in Messages (only noticeable after scrolling back to the previous screen), not into Chrome.
Is there a setting that can change this behavior? It is always counterintuitive to have the app that's visible on my current desktop not actually be the one I'm controlling.
I just found that this issue occurs consistently when switching between screens with Messages and Chrome, but doesn't seem to happen for all apps. E.g., when I switch between screens with Notes and Chrome, the control switches to the new app as desired.