How to automatically bring an activated window to the foreground? [duplicate]

When I have a file browser and an image viewer opened and I double click a photo, the image viewer doesn't jump to the foreground, its icon just shakes a bit and acquires a glow around it, and I have to manually click on it to actually see the photo. How could I make it automatic, so that a double click on a photo shows it immediately, even when the image viewer is already opened in the background?


This behaviour can be changed from the command line, open a terminal and type:

dconf write /org/compiz/profiles/unity/plugins/core/focus-prevention-level 0

To restore the default value:

dconf write /org/compiz/profiles/unity/plugins/core/focus-prevention-level 1