EDIT: I made a small XCode project on GitHub that replicates the issue I'm describing: https://github.com/mdinacci/testnscursor

I have a custom NSTableCellView in which I track mouse enter/exit events over a NSTextField. When the mouse enter the field, I change the cursor to a pointing hand:

- (void)mouseEntered:(NSEvent *)theEvent
{
    NSCursor *cursor = [NSCursor pointingHandCursor];
    [cursor set];
}

- (void)mouseExited:(NSEvent *)theEvent
{
    NSCursor *cursor = [NSCursor arrowCursor];
    [cursor set];
}

The table is displayed inside an NSPopover and the code above works beautifully when the popover is in focus, but it doesn't when the popover is unfocused. The cell view does receive the enter/exit events, but the cursor simply won't update.

Is this a bug ? Any ideas why the cursor won't update when the popover isn't in focus ?

有帮助吗?

解决方案

Apple confirmed it's a bug (#2277286) and as far as I know there's no available workaround.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top