Is there a way to check whether Blender is currently focused / on the foreground / active (in both Windows and Linux)?
We're sending data to Blender, and this would help us determine which Blender instance the data should be send to and at what rate. Say for example that when instance A of Blender is focused, the data is send at a rate of 30x per second, but when in the background, it is only send 1x per second to reduce the burden. We want to do this automatically without requiring any active interaction from the user.
I tried searching for keywords like "focus", "foreground" or "active" in the Blender API documentation, but to no avail. I might have overlooked it though.