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?