10

How can I change delay before focus when having focus-mode: mouse in gnome 3?

I am used to this behaviour from my previous WM (awesome), but I decided to give a Gnome another try (last used was gnome2) and I havem more or less happy so far, only this mouse focus thing is bugging me. I am used to no delay when focusing window under mouse, but I cannot find any setting do to this in gnome3.

I so far tried googling, some medling with dconf editor but so far I have no luck in solving this.

peterh
  • 2,553
  • 10
  • 31
  • 49
graywolf
  • 239
  • 3
  • 12

2 Answers2

8

You can change this by disabling the option focus-change-on-pointer-rest in schema org.gnome.shell.overrides (which overrides the original option in org.gnome.mutter while GNOME Shell is running).

But note that this might actually have more downsides than you expect.

When this option is enabled, there is a hardcoded delay of 25 milliseconds "to check whether the pointer has stopped moving after a crossing event", added in commit 59bc5b7 in response to bug report 678169.

commit 59bc5b7975f1f19ebacb520c1c2666c0828d1111

display: (Optionally) delay focus changes in focus-follows-mouse mode

Moving focus immediately on crossing events as we currently do
in focus-follows-mouse mode may trigger a lot of unwanted focus
changes when moving over unrelated windows on the way to a target.
Those accidental focus changes

 - prevent features like GNOME Shell's application menu from
   working properly

 - and are visually expensive since we now use a very distinct
   style for unfocused windows.

Instead, delay the actual focus change until the pointer has stopped
moving.

(Commit message reformatted to emphasize the reasons.)

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • This thread is a bit old, but I was struggling with this on ubuntu 18.04 and found I also needed to disable `focus-change-on-pointer-rest` in `org.gnome.shell.extensions.classic-overrides`. – Haru Dec 29 '18 at 12:34
  • For those (like me) struggling to work out the syntax of the command line: `gsettings set org.gnome.shell.overrides focus-change-on-pointer-rest false` – spookypeanut Feb 19 '19 at 12:32
  • 1
    On 18.04, I had to set `focus-change-on-pointer-rest` on `org.gnome.mutter`; setting it on `org.gnome.shell.overrides` and `org.gnome.shell.extensions.classic-overrides` had no effect. – Paul Brannan May 01 '19 at 14:48
6

$ gsettings set org.gnome.mutter focus-change-on-pointer-rest false

This worked for me in Gnome 3.30.

premek.v
  • 161
  • 1
  • 4
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://superuser.com/help/whats-reputation) you will be able to [comment on any post](https://superuser.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/956467) – Burgi Feb 28 '20 at 09:47
  • 1
    While your post answers the question and it looks worthy, please write some textual explanation, what it does and how. Do it quickly, a vote is going on about its deletion. – peterh Feb 28 '20 at 12:42
  • 1
    @Burgi The answer looks very hardcore and useful, I suggest leniency. I would happily extend it to avoid the closure, but not even I can do it. – peterh Feb 28 '20 at 12:44
  • 1
    + Gnome 3.36 works too. – spacediver Sep 11 '20 at 07:34