Ask Your Question

how do I make focus follow the mouse?

asked 2017-12-27 14:12:32 -0500

scb gravatar image

I want the keyboard focus to be in whichever terminal window the mouse cursor is in. That has not been default behavior for many years, sadly, but at least there has usually been some sort of windows setting that could easily be set. I don't see one in Fedora 27.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-12-27 14:45:39 -0500

villykruse gravatar image

This depends very much on the window manager you are using. For example the xfce window environment with xfwm4 has a configuration setting for this.

edit flag offensive delete link more


so does cinnamon and I would also assume others have that feature.

SteveEbey73701 gravatar imageSteveEbey73701 ( 2017-12-28 14:06:10 -0500 )edit

answered 2017-12-31 09:54:28 -0500

markito3 gravatar image

updated 2017-12-31 10:01:18 -0500

Here is a session that does it for gnome shell from the command line:

# remember what gsettings does
> gsettings 
  gsettings --version
  gsettings [--schemadir SCHEMADIR] COMMAND [ARGS?]

  help                      Show this information
  list-schemas              List installed schemas
  list-relocatable-schemas  List relocatable schemas
  list-keys                 List keys in a schema
  list-children             List children of a schema
  list-recursively          List keys and values, recursively
  range                     Queries the range of a key
  describe                  Queries the description of a key
  get                       Get the value of a key
  set                       Set the value of a key
  reset                     Reset the value of a key
  reset-recursively         Reset all values in a given schema
  writable                  Check if a key is writable
  monitor                   Watch for changes

Use ?gsettings help COMMAND? to get detailed help.

# look for something that has to do with mouse focus
> gsettings list-recursively | grep focus focus-change-on-pointer-rest true
org.gnome.desktop.wm.preferences focus-new-windows 'smart'
org.gnome.desktop.wm.preferences focus-mode 'sloppy'
org.freedesktop.IBus.Chewing clean-buffer-focus-out false focus-change-on-pointer-rest true
org.gnome.Empathy.notifications notifications-focus true focus-active-notification ['<super>n']
org.gnome.mutter focus-change-on-pointer-rest false unfocused false
org.gnome.desktop.a11y.magnifier focus-tracking 'proportional' focus-active-notification ['<super>n']
org.gnome.Empathy.notifications notifications-focus true
# show the options for org.gnome.desktop.wm.preferences focus-mode
> gsettings range org.gnome.desktop.wm.preferences focus-mode 
# set focus-mode to 'mouse'
> gsettings set org.gnome.desktop.wm.preferences focus-mode mouse
# see what was done
> gsettings get org.gnome.desktop.wm.preferences focus-mode

Personally, I prefer 'sloppy' to 'mouse'. That way when the mouse pointer is outside of all windows, focus remains with the last window in focus.

edit flag offensive delete link more


very good answer; especially explaining how to get there - teach a man how to fish

spacerfrog gravatar imagespacerfrog ( 2018-02-28 15:07:40 -0500 )edit

Question Tools


Asked: 2017-12-27 14:12:32 -0500

Seen: 2,516 times

Last updated: Dec 31 '17