Search code examples
macoskernelscreen-scrapingquartz-graphicsdarwin

How to add an extended workspace on mac without connecting an external monitor?


So, I wanted to cast my extended workspace (on MAC) to my app on iOS. I've been reading on it for a few days and singled out Quartz display services API to capture the screen directly from the GPU for each display connected.

As for my use case, I need to stream it through HTTP on a local wifi network and be able to receive it in my app. The problem is, Mac won't extend the workspace without connecting a compatible device like a projector or a monitor. How do I work around this? I need to be able to cast only the extended workspace through HTTP/tcp and it seems possible from what I've read. I've also looked into IOKit and other related sources but they did not have much of useful info for me. Since the goal is to stream the extended workspace to other devices from the MAC, connecting a real secondary display is useless and does not make sense.

Can we work around this by somehow making the kernel think that there is another display connected?

Is there any other way to spawn an extended desktop and cast it?

Any help will be greatly appreciated.


Solution

  • I found a Github repo which does what I wanted to do to some extent. They have actually written a driver that enables multiple virtual desktops by tricking mac to think it was connected to a physical monitor. For someone like me in the future, take a look into this link.

    Any other inputs to achieve this will also be great.