Solution: Origin keeps ‘alt-tab’ing in front of my game!

Problem: You are gaming/typing/using your computer and your foreground window in Windows loses focus. Origin game client may appear briefly in front of your window, then disappear.

TL/DR – in my instance, it was Star Wars Battlefront 2 (I even caught it once running Battlefront 2 (update maybe?) and it seized control of foreground 3-4 times in a row. I’ve uninstalled Star Wars Battleground 2 and the issue appears to be resolved for me. At least 10 hours of non-alt-tab-hell.


I have this annoying problem and saw the developers at EA were struggling with it. So I figured I’d take a look…

I collected a trace with WPRui.exe using the following check boxes:

  • First Level Triage
  • CPU
  • Desktop Composition Activity

I then let it record until the problem happened, and saved the recording. The resulting log was 10GB in size (I have 64GB of RAM installed so this was somewhat expected). WPA will not open the file however, I’ve been sitting at this for the last 2 hours:

So I decided I’d try PerfView. PerfView is like WPA, but different. Way different. You can find it on Github naturally. On Git there are a lot of video and tutorial links, which I ignored with abandon and set off to explore.

First less on PerfView is, it by default won’t display any more than 20,000,000 events it seems. My trace was a tad, husky, shall we say, so I had to change the cmdline to “PerfView64.exe /SkipMSec:340000” which told it “Hey, open the trace, but don’t really load a lot of detail until you pass 340,000 ms of time.” My trace was about 470 seconds long, so this starts really watching around 340 seconds in give or take.

The first area of PerfView I went to was the Process List.

This gave me a list first of all transient processes, then below a list of persistent processes in the trace. I searched for all Origin processes to get the PIDs I might need, and to see which ones died, what their exit codes were, which ones were persistent, etc.

Then I double-clicked on Events. This shows every event that happened in the time range of my view, but I knew what I was looking for. Two in fact. Win32k manages what window is in foreground (and a lot of other things). The specific two events I was looking for were:

Microsoft-Windows-Win32k/FocusedProcessChange and Microsoft-Windows-Win32k/FocusChange. These would tip me off when I left my explorer window temporarily by Origin preempting my UI. I found several of these.

So that’s a list of every time the foreground window in my UI changed. Next I looked for quick transition times. See the 470,010-471,736? This was the flicker. It was interesting because it seemed to ‘minimize’ but (and this is how I’ve always experienced this) still was foreground, until I took it back. One example of the behavior I had was the screen flickered while I was scrolling down a web page with my mouse wheel. After the flicker, I had to click the web page again to get the focus, so scrolling could continue. The problem also happened very close to the end of my trace (it’s occurrence being why I stopped the trace in the first place).

What is interesting here to me is that Origin 18076 was the normal Origin process. The 55028 was one of the transient ones. It appears to spawn a sub-process named Origin, to do an ad change/rotation? You’ll see what I mean when you see the command line:

tada! Look at the args for the origin.exe binary:

+ Process64 Origin (18076) Args: “origin2://game/launch/?offerIds=1035052&title=STAR%u0020WARS%u2122%u0020Battlefront%u2122%u0020II&authCode=&cmdParams=–reactivate”

It’s advertising the game, an offer for it, whatever. And it’s annoying as hell.

Origin/EA, please stop. (You can see Origin!? is calling user32!SetForegroundWindow, btw at the bottom).



Leave a Reply