Screensaver on multiple monitors
Screensaver on multiple monitors
- Subject: Screensaver on multiple monitors
- From: Gabriel Zachmann <email@hidden>
- Date: Thu, 10 Feb 2011 17:33:43 +0100
I am developing a screensaver that is (should) be able to run simultaneously on multiple monitors (= screens) attached to the same machine (not mirrored).
It seems to be doing fairly well so far, except for two glitches, which is why I am asking here.
1.
Occasionally, my screensavers output some info to the log file.
The way they are configured right now, they do this at exactly the same point in time.
The funny thing is, that the log messages I am seeing in system.log are exactly the *same*, i.e., I get every message exactly twice, and I get messages only from one screensaver, not from the other, although both screensaver instances output *different* messages.
(I could change the configuration so that the screensaver instances output at different points in time, but that is not the point.)
It almost seems like one screensaver just overwrites the message of the other, and then the OS logs two identical messages.
For logging messages , I am using this code:
- (void) logMessage: (NSString*) msg
{
if ( [ msg canBeConvertedToEncoding: NSUTF8StringEncoding] )
asl_log( NULL, log_msg_, ASL_LEVEL_NOTICE, "%s", [msg UTF8String] );
else
asl_log( NULL, log_msg_, ASL_LEVEL_NOTICE, "%s", (char*) [[msg dataUsingEncoding: NSASCIIStringEncoding allowLossyConversion: YES] bytes] );
}
where log_msg_ is an instance variable.
Am I doing anything wrong?
Is asl_log() not thread-safe?
2.
My screen saver can react to some keyboard input while running (like pause).
In my experience, it is always the screensaver rendering to the main screen that gets the keyboard input.
Is there any way to move the keyboard focus to the other screensaver?
On the other hand, even if it was possible to move the keyboard focus by moving the mouse, I am a bit uncertain whether that would be such a good idea ... any thoughts?
Thanks a lot in advance.
Best regards,
Gabriel.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden