11

The issue started after installing Windows 11 (It was fine in Windows 10).

Every 5-10 minutes, I lose focus on active window. It's annoying esp when I am on full-screen mode.

I started trying writing a random word and pressing Enter when that happens. I notice the Edge browser opens with that word as the keyword on bing search.

Note: My default browser is set to Chrome.

How do I find the culprit?

6

4 Answers 4

8

Thank you @ClioCJS for the program.

I also found that mstsc is stealing focus.

As described here: my issue was also connected to WSLg.

In this article I found the way to stop wsl:

wsl --shutdown

I also created '.wslconfig' in the user profile folder file with the following content:

[wsl2]
guiApplications=false

Docker crashed, but I will figure it out later. Everything is ok for now.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 6, 2023 at 21:47
4

I have a focus-monitor.exe that outputs to the console the filename of each process that takes focus. It's very useful for this situation.

If you would like to try it, I posted it here: https://mega.nz/file/4Y8nnbSa#Pnw97sQz8bRM_bXjlrcYT_HGiaBd4kdY_6DNq0T7FWE

0

Hard to tell. There are options like running another app to log focus changes and find the issue there.

I was lucky that I was also getting errors in JetBrains Rider app about ADB (Android Debug Bridge) crashing/restarting constantly.

I checked the event logs (EventViewer) and noticed the same: event log

The are all about ADB crashing and starting.

I head to a terminal and run adb server manually and seems like fine as long as that terminal is open (i.e I don't get focus loss any more).

Sorry if this does not explain much about your case but probably yet another case of focus stealing issues.

0

Thank you to @ClioCJS that little exe helped me find out that mstsc.exe was stealing my window focus allowing me to find this issue:

https://answers.microsoft.com/en-us/windows/forum/all/mstscexe-stealing-focus/f9acb6fd-3c95-4e22-8f40-dc41dffbb178

I tried the steps suggested by Jaspreet.Singh_050 by ultimately a reboot resolved the issue for me. In my case, I suppose Remote Desktop Manager would have caused this.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 3, 2023 at 9:08

You must log in to answer this question.