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.

  • $\begingroup$ Might be easiest to use a third party package, or a subprocess to system command. Related blender.stackexchange.com/a/206223/15543 shows that a "Blender" class window is active from ewmh on linux. $\endgroup$ – batFINGER Jan 13 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.