diff --git a/src/macos/mod.rs b/src/macos/mod.rs index 1164165..02a0e36 100644 --- a/src/macos/mod.rs +++ b/src/macos/mod.rs @@ -2,11 +2,16 @@ mod keyboard; mod view; mod window; -use cocoa::foundation::NSUInteger; pub use window::*; -const NSDragOperationNone: NSUInteger = 0; -const NSDragOperationCopy: NSUInteger = 1; -const NSDragOperationLink: NSUInteger = 2; -const NSDragOperationGeneric: NSUInteger = 4; -const NSDragOperationMove: NSUInteger = 16; +#[allow(non_upper_case_globals)] +mod consts { + use cocoa::foundation::NSUInteger; + + pub const NSDragOperationNone: NSUInteger = 0; + pub const NSDragOperationCopy: NSUInteger = 1; + pub const NSDragOperationLink: NSUInteger = 2; + pub const NSDragOperationGeneric: NSUInteger = 4; + pub const NSDragOperationMove: NSUInteger = 16; +} +use consts::*; diff --git a/src/macos/view.rs b/src/macos/view.rs index 80abdab..4eaa374 100644 --- a/src/macos/view.rs +++ b/src/macos/view.rs @@ -467,7 +467,7 @@ extern "C" fn dragging_updated(this: &Object, _sel: Sel, sender: id) -> NSUInteg on_event(state, event) } -extern "C" fn prepare_for_drag_operation(_this: &Object, _sel: Sel, sender: id) -> BOOL { +extern "C" fn prepare_for_drag_operation(_this: &Object, _sel: Sel, _sender: id) -> BOOL { // Always accept drag operation if we get this far // This function won't be called unless dragging_entered/updated // has returned an acceptable operation @@ -492,10 +492,8 @@ extern "C" fn perform_drag_operation(this: &Object, _sel: Sel, sender: id) -> BO } } -extern "C" fn dragging_exited(this: &Object, _sel: Sel, sender: id) { +extern "C" fn dragging_exited(this: &Object, _sel: Sel, _sender: id) { let state: &mut WindowState = unsafe { WindowState::from_field(this) }; - let modifiers = state.keyboard_state().last_mods(); - let drop_data = get_drop_data(sender); on_event(state, MouseEvent::DragLeft); }