File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -1159,27 +1159,20 @@ - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
11591159 const NSUInteger count = [objs count ];
11601160 if (count)
11611161 {
1162- char ** paths = calloc (count, sizeof (char *));
1163-
11641162 for (NSUInteger i = 0 ; i < count; i++)
11651163 {
11661164 id obj = objs[i];
11671165 if ([obj isKindOfClass: [NSURL class ]]) {
1168- paths[i] = _glfw_strdup ([obj fileSystemRepresentation ]);
1166+ const char *path = [obj fileSystemRepresentation ];
1167+ _glfwInputDrop (window, " text/uri-list" , path, strlen (path));
11691168 } else if ([obj isKindOfClass: [NSString class ]]) {
1170- paths[i] = _glfw_strdup ([obj UTF8String ]);
1169+ const char *text = [obj fileSystemRepresentation ];
1170+ _glfwInputDrop (window, " text/plain;charset=utf-8" , text, strlen (text));
11711171 } else {
11721172 _glfwInputError (GLFW_PLATFORM_ERROR,
11731173 " Cocoa: Object is neither a URL nor a string" );
1174- paths[i] = _glfw_strdup (" " );
11751174 }
11761175 }
1177-
1178- _glfwInputDrop (window, (int ) count, (const char **) paths);
1179-
1180- for (NSUInteger i = 0 ; i < count; i++)
1181- free (paths[i]);
1182- free (paths);
11831176 }
11841177
11851178 return YES ;
You can’t perform that action at this time.
0 commit comments