UI/AppKit: Restore custom cursor shown on link hover

This seems to have broken in some recent-ish AppKit update. When we add
the status label to the view hierarchy / change its visibility state,
the NSApp is resetting the cursor to the standard cursor. By overriding
the cursorUpdate method to do nothing, we prevent this from happening.
This commit is contained in:
Timothy Flynn 2025-04-01 08:54:40 -04:00
parent c5c3859205
commit 0c9dc91d5a

View file

@ -1684,6 +1684,13 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
m_modifier_flags = event.modifierFlags;
}
- (void)cursorUpdate:(NSEvent*)event
{
// The NSApp will override the custom cursor set from on_cursor_change when the view hierarchy changes in some way
// (such as when we show self.status_label on link hover). Overriding this method with an empty implementation will
// prevent this from happening. See: https://stackoverflow.com/a/20197686
}
#pragma mark - NSDraggingDestination
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)event