macOS: Correct prepareForDragOperation: signature (#741)

This commit is contained in:
Francesca Plebani 2018-12-27 14:22:00 -05:00 committed by GitHub
parent cb76dcae2a
commit 33c8aa660f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -16,6 +16,7 @@
- On Wayland, DPI calculation is handled by smithay-client-toolkit. - On Wayland, DPI calculation is handled by smithay-client-toolkit.
- On X11, `WindowBuilder::with_min_dimensions` and `WindowBuilder::with_max_dimensions` now correctly account for DPI. - On X11, `WindowBuilder::with_min_dimensions` and `WindowBuilder::with_max_dimensions` now correctly account for DPI.
- Added support for generating dummy `DeviceId`s and `WindowId`s to better support unit testing. - Added support for generating dummy `DeviceId`s and `WindowId`s to better support unit testing.
- On macOS, fixed unsoundness in drag-and-drop that could result in drops being rejected.
# Version 0.18.0 (2018-11-07) # Version 0.18.0 (2018-11-07)

View file

@ -330,7 +330,9 @@ impl WindowDelegate {
} }
/// Invoked when the image is released /// Invoked when the image is released
extern fn prepare_for_drag_operation(_: &Object, _: Sel, _: id) {} extern fn prepare_for_drag_operation(_: &Object, _: Sel, _: id) -> BOOL {
YES
}
/// Invoked after the released image has been removed from the screen /// Invoked after the released image has been removed from the screen
extern fn perform_drag_operation(this: &Object, _: Sel, sender: id) -> BOOL { extern fn perform_drag_operation(this: &Object, _: Sel, sender: id) -> BOOL {
@ -465,7 +467,7 @@ impl WindowDelegate {
decl.add_method(sel!(draggingEntered:), decl.add_method(sel!(draggingEntered:),
dragging_entered as extern fn(&Object, Sel, id) -> BOOL); dragging_entered as extern fn(&Object, Sel, id) -> BOOL);
decl.add_method(sel!(prepareForDragOperation:), decl.add_method(sel!(prepareForDragOperation:),
prepare_for_drag_operation as extern fn(&Object, Sel, id)); prepare_for_drag_operation as extern fn(&Object, Sel, id) -> BOOL);
decl.add_method(sel!(performDragOperation:), decl.add_method(sel!(performDragOperation:),
perform_drag_operation as extern fn(&Object, Sel, id) -> BOOL); perform_drag_operation as extern fn(&Object, Sel, id) -> BOOL);
decl.add_method(sel!(concludeDragOperation:), decl.add_method(sel!(concludeDragOperation:),