1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-11 14:25:57 +03:00

macos: speculative fix to drag-n-drop crash

refs: https://github.com/wez/wezterm/issues/4771
This commit is contained in:
Wez Furlong 2024-02-10 17:30:40 -07:00
parent e7fe7c07da
commit 67bdc06d73
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
2 changed files with 18 additions and 0 deletions

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

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);