I added NSTrackingArea to my opinion in order to capture mouseEntered / mouseExited events. It is working. Then, when the mouseEntered event gets captured, I do
[self.window invalidateCursorRectsForView:self]
And in the - (void)resetCursorRects I draw an image, create an NSCursor from it, and then:
[self addCursorRect:self.bounds cursor:myCursor]
It seems that the work is good, but sometimes when dragging with the mouse (mouse down and drag) the cursor flashes above the cursor (some mysterious black square appears under the cursor, the size of which is perfect for my cursor size. As this problem does not appear if my cursor When it gets bigger, it starts to blink, and it doesnβt appear until other drawings are executed at the same time.
What could be the problem?
Screens:
good point: 
Bad point: 
source share