how to tell if my app is visible.
how to tell if my app is visible.
- Subject: how to tell if my app is visible.
- From: Memo Akten <email@hidden>
- Date: Mon, 22 Sep 2008 12:07:43 +0100
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@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