27

I found multiple answers on askUbuntu about this topic. But none of them suites to Ubuntu 17.10. So I need to ask again:

How do I set focus follows mouse in Ubuntu 17.10?

pomsky
  • 67,112
  • 21
  • 233
  • 243
eDeviser
  • 1,989
  • 7
  • 20
  • 37
  • related: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1726195 (for me, seems broken specifically when switching from unity to gnome, and/or to 17.10 and wayland): I'm used to using "sloppy" focus following mouse, but I still expect alt-tab to set focus to the selected window, but in 17.10, it's necessary to actually move the mouse to the window (and let it stop, then keep it there) – michael Feb 26 '18 at 02:49

1 Answers1

42

You may use (GNOME) Tweaks to achieve your goal. If it's not installed, first install it by running

sudo apt install gnome-tweaks

Launch Tweaks and go to the Windows section. Select "Sloppy" or "Secondary-Click" under Window Focus.

enter image description here

Alternatively you may run the following command

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

etc.

kynan
  • 2,207
  • 1
  • 22
  • 24
pomsky
  • 67,112
  • 21
  • 233
  • 243
  • 4
    Is there a way to set it to change focus as soon as the mouse enters the window, rather than when the mouse stops moving? – Dominick Pastore Jan 21 '18 at 19:01
  • 1
    What a sloppy UI! Looks like checkboxes, and looks disabled to boot! Is actually radio-button-like. Click on the one you want, ignore your instinctive urge to untick the ticked one. – Phil May 02 '18 at 23:15
  • 2
    I've confirmed that gnome-tweaks work on Ubuntu 18.10 (Cosmic Cuttlefish). Choose "Secondary Click" and it will work. – leo4jc Nov 15 '18 at 23:26
  • _The joy of Linux_: change the OSs behaviour by a simple switch. Customize it as you please. – Dohn Joe Oct 15 '19 at 12:15
  • Is it also 18.04 safe? :-) – matanster Nov 13 '19 at 13:08
  • @matt Should work fine. – pomsky Nov 13 '19 at 13:49
  • FWIW worked for me on 18.04 (though, I tried the `gsettings` first and while that seemed to toggle the setting it didn't actually change the behavior) – Wayne Werner Dec 18 '19 at 02:49
  • For whoever cares, the `gsettings` command also works in Fedora 32. – tekknolagi Jan 09 '21 at 07:50
  • 2
    @DominickPastore to make the focus change immediate run `gsettings set org.gnome.mutter focus-change-on-pointer-rest false` – Jesse May 25 '22 at 04:43
  • Is the opposite possible? I.e.: Move the mouse to window automatically when changing windows with the keyboard, for example with `alt+tab` or `Super+1-9`? – MiniGod Feb 10 '23 at 14:35