Typical situation is that I type something (worst case is my password) in some application, when some other application pops up a window and steals the focus, so my typing (password) goes to something else. I would like to prevent this, at least when I actively type something in an edit box. I always really hated this on Windows, but I never found a way to prevent this. I started using Ubuntu a while ago, and so far I was able to do everything I wanted, so I thought maybe this is also possible. Thanks in advance!
4 Answers
Install CompizConfig Settings Manager
- either from Ubuntu Software Center
or via terminal:
sudo apt-get install compizconfig-settings-manager
Open CompizConfig Settings Manager and go to General -> General options -> Focus and raise behaviour
Change the 'Focus prevention level' from 'Low' to 'Normal'.
- 70,557
gsettings set org.gnome.desktop.wm.preferences focus-new-windows 'smart'
(I tried the first comment which set the setting to 'strict' but found this didn't work. I also found a tutorial when I searched this setting, that was trying to make windows steal focus like WindowsOS does(opposite of OP), and he set it to 'strict' to accomplish this, and said 'smart' caused things to NOT steal focus. I tried 'smart' and it worked. I can now type freely into a terminal while programs open and they don't steal focus. Ubuntu 18.04) https://major.io/2015/07/06/allow-new-windows-to-steal-focus-in-gnome-3/#:~:text=Open%20dconf%2Deditor%20and%20navigate,and%20you%20can%20select%20strict.
- 111
If you are using Cinnamon, there is an easy solution which I found here:
https://superuser.com/questions/1377530/how-to-prevent-programs-stealing-focus-in-mint-linux-19
Search for 'Windows', then:
Windows > Behaviour > Prevent focus stealing > On.
I was experiencing this issue with Thunderbird Lightning Popups and could now finally resolve this.
- 160
As you haven't accepted an answer yet, perhaps using this bug - a minimized always-on-top window to not even put on-demand new windows on top, would help.
- 631
