X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6239ee05567eac71754f56c2a154222d10b57ff1..0c1cc9483ecba053bc9a0983a4a8d48898e334f2:/src/mac/carbon/dnd.cpp diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index dc9b4b60b1..961eb6da0f 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -212,11 +212,13 @@ wxDropSource::~wxDropSource() { } -OSStatus wxMacPromiseKeeper( PasteboardRef inPasteboard, PasteboardItemID inItem, CFStringRef inFlavorType, - void *inContext ) +OSStatus wxMacPromiseKeeper(PasteboardRef WXUNUSED(inPasteboard), + PasteboardItemID WXUNUSED(inItem), + CFStringRef WXUNUSED(inFlavorType), + void * WXUNUSED(inContext)) { OSStatus err = noErr; - + // we might add promises here later, inContext is the wxDropSource* return err; @@ -233,37 +235,37 @@ wxDragResult wxDropSource::DoDragDrop(int flags) RgnHandle dragRegion; OSStatus err = noErr; PasteboardRef pasteboard; - + // add data to drag - + err = PasteboardCreate( kPasteboardUniqueName, &pasteboard ); if ( err != noErr ) return wxDragNone; - + // we add a dummy promise keeper because of strange messages when linking against carbon debug - err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this ); + err = PasteboardSetPromiseKeeper( pasteboard, wxMacPromiseKeeper, this ); if ( err != noErr ) { CFRelease( pasteboard ); return wxDragNone; } - - err = PasteboardClear( pasteboard ); + + err = PasteboardClear( pasteboard ); if ( err != noErr ) { CFRelease( pasteboard ); return wxDragNone; } - PasteboardSynchronize( pasteboard ); - + PasteboardSynchronize( pasteboard ); + m_data->AddToPasteboard( pasteboard, 1 ); - + if (NewDragWithPasteboard( pasteboard , &theDrag) != noErr) { CFRelease( pasteboard ); return wxDragNone; } - + dragRegion = NewRgn(); RgnHandle tempRgn = NewRgn(); @@ -298,7 +300,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) gTrackingGlobals.m_flags = flags; err = TrackDrag( theDrag, &rec, dragRegion ); - + DisposeRgn( dragRegion ); DisposeDrag( theDrag ); CFRelease( pasteboard ); @@ -389,8 +391,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( { wxWindow *win = NULL; ControlPartCode controlPart; - ControlRef control = wxMacFindControlUnderMouse( - toplevel, localMouse, theWindow, &controlPart ); + ControlRef control = FindControlUnderMouse( localMouse, theWindow, &controlPart ); if ( control ) win = wxFindControlFromMacControl( control ); else