parent
b4afbe47b3
commit
c493583f25
@ -15,6 +15,8 @@ Changelog
|
||||
|
||||
- Fix incorrect key repeat rate on wayland (:pull:`1055`)
|
||||
|
||||
- macOS: Fix drag and drop of files not working on mojave (:iss:`1058`)
|
||||
|
||||
0.12.3 [2018-09-29]
|
||||
------------------------------
|
||||
|
||||
|
||||
@ -917,17 +917,24 @@ is_ascii_control_char(char x) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
||||
- (NSArray *)fileURLWithDraggingInfo:(id <NSDraggingInfo>)sender
|
||||
{
|
||||
NSPasteboard *pasteboard = [sender draggingPasteboard];
|
||||
NSArray* files = [pasteboard propertyListForType:NSPasteboardTypeFileURL];
|
||||
NSDictionary *options = [NSDictionary dictionaryWithObject:@YES forKey:NSPasteboardURLReadingFileURLsOnlyKey];
|
||||
NSArray *results = [pasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:options];
|
||||
return results;
|
||||
}
|
||||
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
_glfwInputCursorPos(window,
|
||||
[sender draggingLocation].x,
|
||||
contentRect.size.height - [sender draggingLocation].y);
|
||||
|
||||
const NSArray* files = [self fileURLWithDraggingInfo:sender];
|
||||
if (!files) return NO;
|
||||
const NSUInteger count = [files count];
|
||||
|
||||
if (count)
|
||||
{
|
||||
NSEnumerator* e = [files objectEnumerator];
|
||||
@ -935,7 +942,7 @@ is_ascii_control_char(char x) {
|
||||
NSUInteger i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
paths[i] = _glfw_strdup([[e nextObject] UTF8String]);
|
||||
paths[i] = _glfw_strdup([[[e nextObject] path] UTF8String]);
|
||||
|
||||
_glfwInputDrop(window, (int) count, (const char**) paths);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user