Stop automatic switching of virtual desktops in Windows 10

Having used Linux-based OSs for several years I grew to love the virtual desktops. I was happy to find out that W10 had implemented virtual desktops too. However using them i have found that occasionally the virtual desktops will switch focus automatically.

As far as i can tell there is no real pattern, sometimes it switches after sitting idle for a couple of minutes (but not always), sometimes it switches while i am actively using the virtual desktop (but not always and sometimes it switches back instantly). Also strangely it doesn't focus automatically on the same virtual desktop either, sometimes it is desktop 1 or 2 depending on how many are open (at most 4).

Obviously this is slightly annoying and I have no idea if this is a common problem (google didnt give me any useful results) so am I the only one 'suffering' from it? Regardless, is there a fix?


Solution 1:

After a little experimentation, I believe I have found the answer.

The issue seems to be when Windows focuses on a program. For example, if you click outside of your web browser, you'll notice it grays out. Windows is no longer focused on it, it's focused on the window you clicked.

If you try running a program that's already open in another virtual desktop (depending on its ability to have multiple windows open), it will redirect to the applicable desktop.

Now, in the article below, it talks about "focus stealing". This is where a program steals the window focus for itself. This can and will affect your virtual desktops, so here are some instructions from it on how to prevent this:

How To Prevent Programs From Stealing Focus in Windows

It's not possible for Windows block all programs from stealing focus and still work properly. The goal here is to identify the program that shouldn't be doing this and then figure out what to do about it.

You may know what program keeps stealing focus, but if not, that's the first thing you need to determine. If you're having trouble figuring it out, a free tool called Windows Focus Logger (link in article) can help.

Once you know what program is to blame for the focus stealing, work through the troubleshooting below to make it stop happening for good:

  1. Uninstall the offending program. Frankly, the easiest way to solve a problem with a program that's stealing focus is to remove it.

Note: If the focus stealing program is a background process, you can disable the process in Services, located in Administrative Tools in all versions of Windows. Free programs like CCleaner also provide easy ways to disable programs that start automatically with Windows.

  1. Reinstall the software program that's to blame. Assuming you need the program that's stealing focus, and it isn't doing so maliciously, simply reinstalling it may fix the problem.

Tip: If there's a newer version of the program available, download that version to reinstall. Software developers regularly issue patches for their programs, one of which may have been to stop the program from stealing focus.

  1. Check the program's options for settings that may be causing the focus stealing and disable it. A software maker may see a full screen switch to his or her program as an "alert" feature you want, but you see it as an unwelcome interruption.

  2. Contact the software maker and let them know that their program is stealing focus. Give as much information as you can about the situation(s) where this occurs and ask if they have a fix.

Tip: Please read through my How to Talk to Tech Support for help properly communicating the problem. Last, but not least, you can always try a third-party, anti-focus-stealing tool, of which there are a few:

DeskPins is completely free and let's you "pin" any window, keeping it on top of all others, no matter what. Pinned windows are marked with a red pin and can be "auto-pinned" based on the window's title.

"Window On Top" is another free program that works in much the same way. (Link in article)

Source

Hope this helps!