I'm working in a remote control application for Mac OS, and currently I have a LaunchDaemon working, I'm able to capture monitors, inject mouse and keyboard events during the user context but as soon as I log out my monitor capturing stops working and it is just stuck in this frame.
But my connection to my client is still active and I'm able to login remotely without any video. My set up is LaunchDaemon that runs all the time and that is in charge of sending and receiving events as well as the monitor capturing / streaming. And then a LaunchAgent that provides the ui to interact with my daemon.