macOS: Handle dropping of file promises into kitty in addition to file paths

Fixes #9084
This commit is contained in:
Kovid Goyal
2025-10-11 11:02:51 +05:30
parent ef15aa3f51
commit 3ba6c3f4b9
2 changed files with 14 additions and 1 deletions

View File

@@ -164,6 +164,8 @@ Detailed list of changes
- Fix a regression in 0.43.0 that caused high CPU usage when :opt:`disable_ligatures` was set to ``cursor`` and the tab bar was visible (:iss:`9071`)
- macOS: Handle dropping of file promises into kitty in addition to file paths (:pull:`9084`)
0.43.1 [2025-10-01]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -789,8 +789,19 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
self.identifier = @"kitty-content-view";
[self updateTrackingAreas];
// Register for file promises in addition to regular files (macOS 10.12+)
if (@available(macOS 10.12, *)) {
NSMutableArray *types = [NSMutableArray arrayWithObjects:
NSPasteboardTypeFileURL,
NSPasteboardTypeString,
nil];
// Add file promise types
[types addObjectsFromArray:[NSFilePromiseReceiver readableDraggedTypes]];
[self registerForDraggedTypes:types];
} else {
[self registerForDraggedTypes:@[NSPasteboardTypeFileURL, NSPasteboardTypeString]];
}
}
return self;
}