10

I’ve got a utility Mac application that runs in the background (LSUIElement enabled). Under some condition this application displays a menu window with several buttons. The problem is that when I hover over this window the mouse cursor still behaves according to the application beneath it – when there’s text under the menu, cursor changes to the insertion “I beam” shape.

Obviously I’d prefer a regular pointer arrow. I’ve dived into NSTrackingArea and friends after a bit of hacking I can detect the mouse-enter and mouse-exit events. But when I try to change the current cursor using NSCursor on mouse enter, nothing happens. Looks like the machine refuses to change cursor from an inactive application, because when I activate the application before the mouse-enter event, the cursor changes.

I don’t want to switch the active application just to change the cursor. Is there a way to fiddle with the cursor from an inactive application?

P.S. Same problem on cocoa-dev: one, two.

zoul
  • 102,279
  • 44
  • 260
  • 354
  • I'm looking for a solution to this too. Did you ever find anything? – zadam Jun 20 '11 at 21:44
  • @zadam: No. Fortunately we have changed the application concept anyway, so that we got rid of this requirement. – zoul Jun 21 '11 at 06:06
  • Same problem here. Oddly, before I converted my app from Carbon (HI windows) to Cocoa, I could successfully change the cursor using NSCursor. – Thomas Tempelmann Feb 08 '13 at 16:35

1 Answers1

0

I'm affraid this is not possible due the OS X restrictions.

mirap
  • 1,266
  • 12
  • 23