How to Stop Ubuntu from Automatically Opening New Windows in the Background

The Focus Stealer

In Ubuntu (specifically the default GNOME desktop environment), window management can sometimes feel unpredictable. Depending on the application, if you click a link in a document that opens a web browser, or if you launch a secondary utility from the terminal, Ubuntu might automatically open that new window behind your currently active window. It will often flash the icon in the sidebar to indicate it opened, but it refuses to pull the new application to the forefront. This background opening behavior is designed to prevent “focus stealing” (where a pop-up interrupts your typing), but it can be highly frustrating when you actively requested the new window.

Forcing Immediate Focus

To ensure immediate interaction and stop Ubuntu from automatically opening new windows in the background, you must tweak the GNOME window focus behavior.

You need a specific utility to change this hidden setting. Open your terminal and type sudo apt install gnome-tweaks to install it. Once installed, open the application menu and launch Tweaks. In the left-hand navigation sidebar of the Tweaks application, click on Windows. Look for the setting labelled Window Focus (or sometimes “Focus on New Windows,” depending on your GNOME version). By default, GNOME uses a “Smart” focus mode. You need to ensure the system is set to aggressively focus newly launched applications. If you see an option for Focus Stealing Prevention, you can toggle this off to ensure that when you click to open an app, it immediately appears on top, ready for input.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.