Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nafidhaque

macrumors newbie
Original poster
Dec 9, 2009
5
0
Germany
I am trying to capture a screen shot at regular interval. My code is able to do so however while running this program if I change the user (using fast user switching) to log in to a different account and after a while return back to the previous user running the screen capture program, I notice that my program failed from the point I switched to a different user. Upon further inspection and debugging I noticed that CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay) is giving an Invalid Value as one of the attributes for
NSOpenGLPixelFormatAttribute. Could anyone here help me in solving this issue?
 
It's a security feature.

If any user could access every other user's screen, consider how that could be abused and cause harm.
 
I do not want to access the screen of any other user, but my program should continue to capture the screen of my session (I am in background now and I started the capturing program in my session). The program fails when I log in to a different user keeping the previous user running in background.
 
You're using different users, as far as the OS knows, or can even detect. A different user account is a different user, with a different login process and graphics session. It may be the same person logging in under two user accounts, but there's no way to tell the OS that.

Please explain why it's necessary to run the screen capture as a different user. Depending on what you're trying to accomplish, there may be other ways to do it.
 
You're using different users, as far as the OS knows, or can even detect. A different user account is a different user, with a different login process and graphics session. It may be the same person logging in under two user accounts, but there's no way to tell the OS that.

Please explain why it's necessary to run the screen capture as a different user. Depending on what you're trying to accomplish, there may be other ways to do it.

Maybe so, but it should be possible--at least it was in older versions of OS X. I haven't checked in a year or so. It *was* possible to start a VNC server in one user account, switch to another user using FUS, and then log into the existing VNC account AND USE IT.

While what I'm describing isn't *actually* feasible (I ran into serious keyboard issues when someone was pressing modifier keys on the local keyboard), it does show that a screen recorder doesn't necessarily have to die after a fast user switch.


Since I wasn't involved in the coding part, I can't offer much help there, but you could look into the OSXvnc source code and see if you can find anything useful there.
 
To clarify, when I logged into the VNC server, it was the background user's session that was visible--not the foreground user's session. This didn't break anything security-wise.
 
So you have account A, started the screen cap with account A,

switched to account B, but still want account A activities to be captured?
 
So you have account A, started the screen cap with account A,

switched to account B, but still want account A activities to be captured?

Yes this is exactly what I am trying to do. Account A started the capture program. I move to account B but want the program in account A to keep capturing account A. This far when I make the switch from A to B I see that my program stops with an error. What I found is the displayID required to create the OpenGL context seems to be invalid from the point I made the switch.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.