diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 2 | ||||
-rw-r--r-- | platform/osx/display_server_osx.mm | 38 | ||||
-rw-r--r-- | platform/windows/display_server_windows.cpp | 2 |
3 files changed, 23 insertions, 19 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 7919e47b5c..818e55476e 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -103,7 +103,7 @@ jobject GodotJavaWrapper::get_member_object(const char *p_name, const char *p_cl jobject GodotJavaWrapper::get_class_loader() { if (_get_class_loader) { JNIEnv *env = ThreadAndroid::get_env(); - return env->CallObjectMethod(godot_instance, _get_class_loader); + return env->CallObjectMethod(activity, _get_class_loader); } else { return nullptr; } diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index c4c2426f1f..8d82119ae2 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -751,28 +751,32 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; ERR_FAIL_COND_V(!DS_OSX->windows.has(window_id), NO); DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id]; - NSPasteboard *pboard = [sender draggingPasteboard]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 - NSArray<NSURL *> *filenames = [pboard propertyListForType:NSPasteboardTypeFileURL]; -#else - NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; -#endif + if (!wd.drop_files_callback.is_null()) { + Vector<String> files; + NSPasteboard *pboard = [sender draggingPasteboard]; - Vector<String> files; - for (NSUInteger i = 0; i < filenames.count; i++) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 - NSString *ns = [[filenames objectAtIndex:i] path]; + NSArray *items = pboard.pasteboardItems; + for (NSPasteboardItem *item in items) { + NSString *path = [item stringForType:NSPasteboardTypeFileURL]; + NSString *ns = [NSURL URLWithString:path].path; + char *utfs = strdup([ns UTF8String]); + String ret; + ret.parse_utf8(utfs); + free(utfs); + files.push_back(ret); + } #else - NSString *ns = [filenames objectAtIndex:i]; + NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; + for (NSString *ns in filenames) { + char *utfs = strdup([ns UTF8String]); + String ret; + ret.parse_utf8(utfs); + free(utfs); + files.push_back(ret); + } #endif - char *utfs = strdup([ns UTF8String]); - String ret; - ret.parse_utf8(utfs); - free(utfs); - files.push_back(ret); - } - if (!wd.drop_files_callback.is_null()) { Variant v = files; Variant *vp = &v; Variant ret; diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 62fcd20f61..520b43f963 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2956,7 +2956,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, Rect2i r; r.position = screen_get_position(i); r.size = screen_get_size(i); - Rect2 inters = r.clip(p_rect); + Rect2 inters = r.intersection(p_rect); int area = inters.size.width * inters.size.height; if (area >= nearest_area) { screen_rect = r; |