Is there a way to set up "focus follows mouse" behavior in Ubuntu 11.10/12.04 Unity? This was pretty easy to configure in Ubuntu 10.10.

Thanks!

link|improve this question
You probably want to remove the appmenu-* packages if you enable focus follows mouse mode. Otherwise menus become very anoying to use. – Brandon Mar 31 at 19:31
@brandon In Precise 12.04, the availablity of the Head-Up Display (HUD) mitigates the Unified Menu Bar (UMB) problems, as does the older Alt-F10 option for getting to the menu. For those that love the keyboard, focus follows mouse can still be great. See also the suggestions and discussion at Bug #674138 ""Global” appmenu breaks sloppy focus” : Bugs : unity – nealmcb Apr 30 at 20:55
feedback

3 Answers

up vote 24 down vote accepted

method 1

enter image description here

Use gconf-editor and change the focus-mode value shown to mouse or sloppy

(see note below)

If do not have gconf-editor already installed then you can install via the terminal command:

sudo apt-get install gconf-editor

method 2

use gnome-tweak-tool

enter image description here

change windows focus mode to mouse or sloppy

(see note below)

"mouse" vs "sloppy"

A focus mode "sloppy" seems to work better at allowing Alt+TAB to override focus.

"mouse" means that if the mouse isn't in the window, the window isn't selected, no matter what you've selected in any other way.

The window focus mode indicates how windows are activated. It has three possible values; "click" means windows must be clicked in order to focus them, "sloppy" means windows are focused when the mouse enters the window, and "mouse" means windows are focused when the mouse enters the window and unfocused when the mouse leaves the window.

link|improve this answer
feedback

While you can use the gconf-editor or gnome-tweak-tool to do this, they are not installed by default. I also found (on the intarwebs from http://blog.bodhizazen.net/linux/gnome-3-focus-follows-mouse):

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

Personally, I don't like the auto_raise feature, so I set the second option to "false" and didn't set the auto_raise_delay option.

Note, however, that this ultimately "breaks" the Unified Menu Bar (UMB) (when you mouse off the item you're using and onto another one, the Unified Menu Bar is now reflective of whatever you're now hovering over).

Two Workarounds:

  • Move the window to the top of the screen before accessing UMB
  • Press F10, which will keep UMB open on focused window for you to interact with

Tested as recently as Precise

more edits: I've put "breaks" in quotes - yes, it's not really broken, but it breaks IMO the intent of the UMB, or at least makes it challenging to use as Reese correctly points out in the comment. IMO, that's a "breaks simple usability, but with an annoying workaround." Though given Linux's focus on providing very strong multitasking (which tends to lead to a "cluttered" desktop), it seems that either the UMB diminishes multitasking, or multitasking diminishes the UMB's capabilities. I'll leave that as an exercise to the reader to decide...

link|improve this answer
There should be a delay after which the focus would change, defaulting to e.g. 200ms - this would allow to quickly move across other windows to reach the UMB for example. – blueyed Apr 15 at 16:09
feedback

This can be done through CompizConfig Settings Manager.

CompizConfig

Select the "Focus & Raise Behavior Tab", then uncheck "Click To Focus." Make sure "Auto-Raise" is checked.

More CompizConfig

If you don't have CompizConfig Settings Manager (also known as 'CCSM') installed, you can do so from the Software Center, or from the command line:

sudo apt-get install compizconfig-settings-manager

link|improve this answer
feedback

protected by Community Mar 31 at 20:26

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.