Try looking into using the NSApplication delegate methods that inform you when your app becomes active/hidden, e.g.

- (void)applicationDidBecomeActive:(NSNotification *)aNotification


Thanks
--
John Clayton

On 22/09/2008, at 1:07 PM, Memo Akten wrote:


Hi All, i have an app which is running on the desktop :

        windowRect = [[NSScreen mainScreen] visibleFrame];
window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
        [window setFrame:windowRect display:NO];
        [window setOpaque:NO];
        [window setBackgroundColor:[NSColor clearColor]];
        [window setMovableByWindowBackground:NO];
        [window setLevel:kCGDesktopIconWindowLevel];
        [window setAcceptsMouseMovedEvents:YES];

The app is running a quartz composition, which has custom QCPlugin in it.

My first problem was, that even where there are other app windows (e.g. finder) on top of my app, the app (the quartz composition) responds to mouse events whilst its in the background (e.g. I want animations to trigger if the mouse is over something, but not if its obscured by finder or safari etc.). So I did a check to see if my app was active or not ([[NSApplication sharedApplication] isActive]) before responding to mouse position and events.

That works to some degree, but if I have a window to the side and my app is fully visible, it doesn't respond to mouse position and events - because its not active. But is there a solution to this?









_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/john_clayton %40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to