Re: how to tell if my app is visible.
Re: how to tell if my app is visible.
- Subject: Re: how to tell if my app is visible.
- From: Memo Akten <email@hidden>
- Date: Mon, 22 Sep 2008 14:47:33 +0100
Hi John, thanks for the reply.
My problem is not so much with detecting when the application is
active or not, but detecting whether the mouse is over the application
while the application is not active, but does not have another window
over it. is this even possible?
On 22 Sep 2008, at 13:31, John Clayton wrote:
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@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
_______________________________________________
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