How to Stop Ubuntu Linux from Automatically Changing Workspaces

The Disorienting Desktop Shift

Virtual workspaces are one of the most powerful features of the Ubuntu Linux desktop, allowing you to organize your open applications across multiple distinct screens. However, a highly disorienting behavior occurs when you have an application open on Workspace 2, but you are currently looking at Workspace 1. If you click the icon for that application in the dock, Ubuntu will instantly and violently slide your entire screen over to Workspace 2. This automatic workspace switching can break your focus when you simply wanted to open a second instance of the application on your current screen.

How to Disable Workspace Switching on App Launch

To stop the Ubuntu dock from throwing you across virtual desktops and instead force it to open a new window of the requested application on your current screen, you must change a hidden system preference using the terminal.

1. Open your terminal application (Ctrl+Alt+T).

2. You will use the `gsettings` command-line tool to modify the behavior of the Ubuntu Dock extension. Paste the following command into your terminal and press Enter:

gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true

3. This command immediately instructs the dock to only display and interact with windows that exist on your currently active workspace. If an app is open on Workspace 2, the dock on Workspace 1 will not show its indicator dot, and clicking the app icon will simply launch a fresh window right where you are.

How to Prevent Automatic Switching on App Pop-ups

Another common annoyance is when a background application on a different workspace generates a notification or a pop-up dialog box (like an error message), and Ubuntu forcefully yanks your screen over to that workspace to show it to you.

To disable this specific focus-stealing behavior, you need the GNOME Tweaks tool.

1. If you don’t have it installed, open the terminal and run: sudo apt install gnome-tweaks

2. Launch the Tweaks application from your app grid.

3. In the left-hand sidebar, click on Windows.

4. Look for the setting labelled Focus Stealing Prevention.

5. Ensure this toggle is turned On.

With this enabled, an application on another workspace that demands attention will simply bounce its icon or show a notification, rather than physically dragging your desktop away from what you are currently doing.

Get the best tech tips delivered straight to your inbox.

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