It’s a bluetooth controller. Whenever it connects/disconnects my game will restart. My understanding (as you already pointed out in the stackoverflow question) is this is considered as a configuration change so the default behavior is the window will refresh. I also see the same behavior on other apps like Chrome (the page just refreshes when controller is connected). For browser it might be ok but for an emulator is a bit annoying as all unsaved progress will be lost.