Possible Duplicate:
How do I set focus follows mouse?

I am trying to enable the feature where a window becomes focused (whether in foreground or background) when the mouse hovers over it.

In previous version of Ubuntu this was changed using System > Preferences > Windows but that option is no longer there.

How do I change this setting with the new Ubuntu 11.10?

  • I did a search and that one never came up, thanks! Voted to close.
    – SaultDon
    Jan 8, 2012 at 23:41

2 Answers 2


You need the gnome-tweak-tool to do this. Under "Windows" you have the option to set the mode of the window focus to mouse.

For 14.04 and Unity, the right tool is unity-tweak-tool. Find the feature under (name/selection=name/,): Window Management, Additional Settings,Automatic Raising=Off, Fixing Behaviour: Mouse.


You can make this setting from the command line as well. The advantage is that you do not install a number of dependencies that go with gnome-tweak-tool.

gconftool-2 --type string --set /apps/metacity/general/focus_mode mouse
gconftool-2 --type boolean --set /apps/metacity/general/auto_raise true
gconftool-2 --type string --set /apps/metacity/general/auto_raise_delay 600

The only problem with these settings is that Unity puts the menus for a window at the top of the screen, so it is difficult to use focus follows mouse as the menus may change when you move the mouse.

focus follow mouse works better, IMO, with kde, xfce, or gnome-shell

  • Do you have to log out or restart after?
    – Aalex Gabi
    Feb 8, 2013 at 19:57
  • no, it should take effect right away.
    – Panther
    Feb 8, 2013 at 20:04
  • Is not working with gnome-shell :(
    – Aalex Gabi
    Feb 8, 2013 at 20:14
  • OK, will keep in mind, this is an old post. I have since converted to KDE or XFCE or Fluxbox. Good luck to you.
    – Panther
    Feb 8, 2013 at 20:17
  • I did it with gnome-tweak-tool. Because I use gnome-shell it didn't ask me to install any dependencies.
    – Aalex Gabi
    Feb 8, 2013 at 21:16

Not the answer you're looking for? Browse other questions tagged .