[NSCursor set] not setting the cursor
[NSCursor set] not setting the cursor
- Subject: [NSCursor set] not setting the cursor
- From: Brent Marykuca <email@hidden>
- Date: Mon, 20 Sep 2004 17:48:48 -0700
Hello,
We have a Cocoa application that is a "UI Element", i.e. it sets
LSUIElement=1 in it's property list and doesn't display a menu bar or
show up in the dock. Our application works with some hardware that has
a remote control device.
Part of the app's function is to allow the user to take a snapshot of
the screen and then annotate it. So you could be looking at your
desktop with a Safari window open with your web site on it, and then
press a button on the remote control to activate our app and start to
use a few simple tools to draw on the image of the screen. What is
happening, of course, is we grab the screen image, make ourselves the
front process and display the snapshot in a full screen window and let
the user draw on it. Simple enough.
Since the screen image doesn't change at all when you do this, to
indicate that we're now in a "drawing" mode, we want to change the
mouse cursor from the standard arrow to a "pen". To do this we call
[NSCursor set].
If we do this when our application is already the front process then it
works just fine.
However, if this function is triggered when some other application is
the front process (by far the more common scenario), the cursor stays
set to the arrow and no amount of calling [NSCursor set] will cause it
to change until you click the mouse. That means the user gets no
feedback that they're in this drawing mode.
I have tried everything that I can think of to work around this
problem, including:
-- disabling cursor rectangles on the snapshot window's view
-- used a runloop perform to set the cursor again
-- used a timer to set the cursor again after the application was
frontmost
-- used applicationDidBecomeActive notification to set the cursor
-- used Carbon APIs instead of Cocoa ones
-- made sure that no calls to NSCursor set were being made before the
application was the active one
In all cases, the cursor wouldn't budge from the standard arrow.
My suspicion is that the Window Server is responsible for this, but I'm
not sure where to look to gain an understanding of this behavior and
some ideas for working around it.
Can anyone give me some clues?
Regards,
Brent Marykuca
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden