macos: speculative fix to drag-n-drop crash

refs: https://github.com/wez/wezterm/issues/4771
This commit is contained in:
Wez Furlong committed 2024-02-10 17:32:28 -07:00
1 parent e7fe7c07da
commit 67bdc06d73
2 files changed
+18

No files matched your search

+2
View File
@@ -36,6 +36,8 @@ As features stabilize some brief notes about them will accumulate here.
#4876
* macOS: wacky initial window size with external monitors or certain font
sizes. #4966 #4250
* macOS: dragging non-filename data over wezterm could cause it to crash. #4771
#### Updated
* Bundled conpty.dll and OpenConsole.exe to build 1.19.240130002.nupkg
+16
View File
@@ -2957,8 +2957,16 @@ impl WindowView {
let mut inner = this.inner.borrow_mut();
let pb: id = unsafe { msg_send![sender, draggingPasteboard] };
if pb.is_null() {
return NO;
}
let filenames =
unsafe { NSPasteboard::propertyListForType(pb, appkit::NSFilenamesPboardType) };
if filenames.is_null() {
return NO;
}
let paths = unsafe { filenames.iter() }
.map(|file| unsafe {
let path = nsstring_to_str(file);
@@ -2975,8 +2983,16 @@ impl WindowView {
let mut inner = this.inner.borrow_mut();
let pb: id = unsafe { msg_send![sender, draggingPasteboard] };
if pb.is_null() {
return NO;
}
let filenames =
unsafe { NSPasteboard::propertyListForType(pb, appkit::NSFilenamesPboardType) };
if filenames.is_null() {
return NO;
}
let paths = unsafe { filenames.iter() }
.map(|file| unsafe {
let path = nsstring_to_str(file);