Merge pull request #88987 from bruvzg/macos_12_depr_warn
[macOS] Fix some deprecation warnings.
This commit is contained in:
commit
b0b9c66a7f
@ -2685,7 +2685,7 @@ Ref<Image> DisplayServerMacOS::clipboard_get_image() const {
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:data];
|
NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:data];
|
||||||
NSData *pngData = [bitmap representationUsingType:NSPNGFileType properties:@{}];
|
NSData *pngData = [bitmap representationUsingType:NSBitmapImageFileTypePNG properties:@{}];
|
||||||
image.instantiate();
|
image.instantiate();
|
||||||
PNGDriverCommon::png_to_image((const uint8_t *)pngData.bytes, pngData.length, false, image);
|
PNGDriverCommon::png_to_image((const uint8_t *)pngData.bytes, pngData.length, false, image);
|
||||||
return image;
|
return image;
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendEvent:(NSEvent *)event {
|
- (void)sendEvent:(NSEvent *)event {
|
||||||
if ([event type] == NSSystemDefined && [event subtype] == 8) {
|
if ([event type] == NSEventTypeSystemDefined && [event subtype] == 8) {
|
||||||
int keyCode = (([event data1] & 0xFFFF0000) >> 16);
|
int keyCode = (([event data1] & 0xFFFF0000) >> 16);
|
||||||
int keyFlags = ([event data1] & 0x0000FFFF);
|
int keyFlags = ([event data1] & 0x0000FFFF);
|
||||||
int keyState = (((keyFlags & 0xFF00) >> 8)) == 0xA;
|
int keyState = (((keyFlags & 0xFF00) >> 8)) == 0xA;
|
||||||
|
@ -601,7 +601,9 @@ Error OS_MacOS::create_process(const String &p_path, const List<String> &p_argum
|
|||||||
for (const String &arg : p_arguments) {
|
for (const String &arg : p_arguments) {
|
||||||
[arguments addObject:[NSString stringWithUTF8String:arg.utf8().get_data()]];
|
[arguments addObject:[NSString stringWithUTF8String:arg.utf8().get_data()]];
|
||||||
}
|
}
|
||||||
|
#if defined(__x86_64__)
|
||||||
if (@available(macOS 10.15, *)) {
|
if (@available(macOS 10.15, *)) {
|
||||||
|
#endif
|
||||||
NSWorkspaceOpenConfiguration *configuration = [[NSWorkspaceOpenConfiguration alloc] init];
|
NSWorkspaceOpenConfiguration *configuration = [[NSWorkspaceOpenConfiguration alloc] init];
|
||||||
[configuration setArguments:arguments];
|
[configuration setArguments:arguments];
|
||||||
[configuration setCreatesNewApplicationInstance:YES];
|
[configuration setCreatesNewApplicationInstance:YES];
|
||||||
@ -630,6 +632,7 @@ Error OS_MacOS::create_process(const String &p_path, const List<String> &p_argum
|
|||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
#if defined(__x86_64__)
|
||||||
} else {
|
} else {
|
||||||
Error err = ERR_TIMEOUT;
|
Error err = ERR_TIMEOUT;
|
||||||
NSError *error = nullptr;
|
NSError *error = nullptr;
|
||||||
@ -645,6 +648,7 @@ Error OS_MacOS::create_process(const String &p_path, const List<String> &p_argum
|
|||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
return OS_Unix::create_process(p_path, p_arguments, r_child_id, p_open_console);
|
return OS_Unix::create_process(p_path, p_arguments, r_child_id, p_open_console);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user