OK, this thing was REALLY annoying me. It's not exactly random either, because it happens approximately 5-7mins into use after boot.
What happens is my HTPC boots straight up into XBMC, full screen program which plays movies. After about 5 minutes, something minimises XBMC and then displays the desktop. Very annoying!
I thought it was the notification bubbles, but it wasn't. I even turned them off system wide.
After a quick search or two, there have been suggestions it's fault of either Windows Action Center (which I already have disabled) or bluetooth drivers.
Could it be, THIS?
I took a punt at it and ripped out the USB dongle. Lo and behold, it worked. A whole episode of Top Gear and no kickback to desktop!
This solution whoever, isn't quite ideal. Why? Because I use bluetooth!
So I did what I do best, I fiddled. After a little experimenting, it turns out that having the icon in the tray was causing it to steal focus from the current program and flick you back to the desktop.
So, right click on the icon and select "Open settings".
Untick the box that says "Show the Bluetooth icon in the notification area"
*update!* Also untick "Alert me when a new Bluetooth device wants to connect" (I forgot to put a red circle around this one as well!)
This way, Bluetooth is still enabled and as far as I know, the other settings should be fine. Hopefully this solves the problem for you.