Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
161
rated 0 times [  161] [ 0]  / answers: 1 / hits: 149659  / 3 Years ago, sat, november 20, 2021, 4:27:36

Is there a way to set up "focus follows mouse" behavior in Unity?


More From » unity

 Answers
6

13.04 and later (GUI) (also works on Ubuntu Unity 22.10)


Follow-on-focus settings can be set using the unity-tweak-tool Install unity-tweak-tool


enter image description here


enter image description here


12.10 and later (command line)


The following controls follow-on focus


gsettings set org.gnome.desktop.wm.preferences focus-mode 'sloppy'

or


gsettings set org.gnome.desktop.wm.preferences focus-mode 'mouse'

Use the value 'click' to reset to the standard focus-control.


Note: the difference between 'sloppy' and 'mouse' is described at the bottom of this answer.


In addition you have the following option which when set, automatically raises the window to have focus:


gsettings set org.gnome.desktop.wm.preferences auto-raise true

You can control the delay for this auto-raise capability (in milliseconds):


gsettings set org.gnome.desktop.wm.preferences auto-raise-delay 500

You can change raise-on-click to control what window is on top:


gsettings set org.gnome.desktop.wm.preferences raise-on-click false

12.04


Two methods for 12.04 are presented below:


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

In addition you have the following key which when set, automatically raises the window to have focus - auto-raise.


You can control the delay for this auto-raise capability (in milliseconds) by changing the key value auto-raise-delay


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.



Controlling What Window is on Top


The following window options control what window is in the front of others (or "on top"). It's slightly different than what window has the input focus. The following descriptions help explain slightly.


raise-on-click


Some users who use focus-follows-mouse do not like the windows the interact with to come to the top unless they explicity click on the tilebar of the window. This gives a finer grain of control when working with multiple windows, but can be frustrating for most users.


auto-raise


Some users who use focus-follows-mouse, like to have the window their cursor is over automatically raise to the top. This makes the window in full view, with no other windows eclipsing it.


auto-raise-delay


The length of time to wait before triggering the auto-raise behavior.


[#43186] Saturday, November 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainlyyor

Total Points: 210
Total Questions: 129
Total Answers: 116

Location: Barbados
Member since Sun, Nov 27, 2022
1 Year ago
;