mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-18 01:44:46 +08:00
cocoa: SDL_GetClipboardData() needs to conform the mimetype.
Fixes #16077.
This commit is contained in:
@@ -238,7 +238,8 @@ void *Cocoa_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size
|
||||
for (NSPasteboardItem *item in [pasteboard pasteboardItems]) {
|
||||
NSData *itemData;
|
||||
CFStringRef utiType = GetUTIType(mime_type);
|
||||
itemData = [item dataForType: (__bridge NSString *)utiType];
|
||||
NSString *availableType = [pasteboard availableTypeFromArray:@[(__bridge NSString *) utiType]];
|
||||
itemData = [item dataForType: availableType];
|
||||
CFRelease(utiType);
|
||||
if (itemData != nil) {
|
||||
NSUInteger length = [itemData length];
|
||||
|
||||
Reference in New Issue
Block a user