10

This started happening for me in Ubuntu 22.10 Whenever I open a new window with a shortcut, for example I use the right ALT to open the terminal, the focus does not go to that newly opened windows, but stays in whichever app I am still in.

How can I make it so it behaves like 22.04 where the focus will always go to the newly opened windows.

This only happens to opened apps with shortcuts as it looks, but not with clicked apps or apps opened from the dock.

Luis Alvarado
  • 217,203

1 Answers1

12

Talk about answering ones question too fast. So anyway, the one I was previously testing was:

gsettings set org.gnome.desktop.wm.preferences focus-new-windows 'strict'

But it never worked. Then I tried just for kicks:

gsettings set org.gnome.desktop.wm.preferences focus-new-windows 'smart'

and it worked. Hope this helps anyone with this weird error.

Luis Alvarado
  • 217,203
  • works. when i reboot seems i need to do it again. do i need a autostart - sh script then with this line in? – SL5net Jun 21 '23 at 12:07
  • @SL5net probably will be enough to press Alt + F2, r, Enter – Anton Samokat Apr 28 '24 at 16:17
  • I think @SL5net means that the change does not survive a reboot, not that they need to reboot to get the change to work in the first place. The fix above did not work for me; I had to install the "Steal my focus window" (on GNOME 46—it's a fork of the earlier "Steal my focus" extension for GNOME ≥ 45). – Reuben Thomas Oct 30 '24 at 11:46
  • I had a similar problem, see https://askubuntu.com/questions/1554120/newly-opened-applications-and-terminals-appear-in-the-background-instead-of-fore, and setting smart solved the new window issue, but when I open a new terminal with nautilus, it is still in the background... do you have the same issue? Thanks! – Matifou Aug 07 '25 at 07:42
  • @Matifou Since I am in Ubuntu 25.04 I do not know. It works here already by default. – Luis Alvarado Aug 07 '25 at 16:12