active windows

Windows/buffers are managed by GraphicsEngine class, so just get the engine first. For the default window, it’s base.graphicsEngine, then you can use getNumWindows() and getWindow().