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 committed by Jelle Raaijmakers
parent b64d450f32
commit b23b21fa4a
Notes: github-actions[bot] 2025-04-01 21:11:20 +00:00

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