This little tip is for those who like a clear desktop with only one application window open at once. With a Terminal command you can auto hide all inactive application windows from the desktop. You can switch between them by clicking on a Dock icon and only the windows from this application will show up on the desktop.
Auto hide Inactive OS X Application Windows
Open Terminal by Application/Utilities /Terminal.app or type Terminal in the Spotlight search.
Run the following command:
defaults write com.apple.dock single-app -bool TRUE;killall Dock
The Changes will take effect the next time you click on a Dock icon and will autohide all inactive application windows.
Reset Default Settings:
defaults delete com.apple.dock single-app;killall Dock