summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_cocoa.mm25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 15ed5fbd5..37982db02 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -556,6 +556,8 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop()
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
+- (void)draggingSession:(NSDraggingSession *)session
+ endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation;
#endif
- (BOOL)did_view_resolution_change;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
@@ -2741,6 +2743,17 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
{
return NSDragOperationCopy;
}
+- (void)draggingSession:(NSDraggingSession *)session
+ endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation
+{
+ Fl_Widget *w = Fl::pushed();
+ if ( w ) {
+ int old_event = Fl::e_number;
+ w->handle(Fl::e_number = FL_RELEASE);
+ Fl::e_number = old_event;
+ Fl::pushed( 0 );
+ }
+}
#endif
@end
@@ -4093,14 +4106,14 @@ int Fl_Cocoa_Screen_Driver::dnd(int use_selection)
[myview dragImage:image at:pt offset:offset // deprecated in 10.7
event:theEvent pasteboard:mypasteboard
source:myview slideBack:YES];
+ if ( w ) {
+ int old_event = Fl::e_number;
+ w->handle(Fl::e_number = FL_RELEASE);
+ Fl::e_number = old_event;
+ Fl::pushed( 0 );
+ }
}
CFRelease(text);
- if ( w ) {
- int old_event = Fl::e_number;
- w->handle(Fl::e_number = FL_RELEASE);
- Fl::e_number = old_event;
- Fl::pushed( 0 );
- }
[localPool release];
return true;
}