mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 23:06:54 +08:00
macOS: Avoid premature FL_RELEASE event at start of drag-n-drop operation.
This fixes this issue mentioned in fltk.general : https://www.fltk.org/newsgroups.php?s40623+gfltk.general+v40638+T
This commit is contained in:
+13
-2
@@ -2700,6 +2700,17 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
|
|||||||
}
|
}
|
||||||
fl_unlock_function();
|
fl_unlock_function();
|
||||||
}
|
}
|
||||||
|
- (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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
|
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
|
||||||
{
|
{
|
||||||
return NSDragOperationGeneric;
|
return NSDragOperationGeneric;
|
||||||
@@ -4342,14 +4353,14 @@ int Fl_X::dnd(int use_selection)
|
|||||||
[myview dragImage:image at:pt offset:offset // deprecated in 10.7
|
[myview dragImage:image at:pt offset:offset // deprecated in 10.7
|
||||||
event:theEvent pasteboard:mypasteboard
|
event:theEvent pasteboard:mypasteboard
|
||||||
source:myview slideBack:YES];
|
source:myview slideBack:YES];
|
||||||
}
|
|
||||||
CFRelease(text);
|
|
||||||
if ( w ) {
|
if ( w ) {
|
||||||
int old_event = Fl::e_number;
|
int old_event = Fl::e_number;
|
||||||
w->handle(Fl::e_number = FL_RELEASE);
|
w->handle(Fl::e_number = FL_RELEASE);
|
||||||
Fl::e_number = old_event;
|
Fl::e_number = old_event;
|
||||||
Fl::pushed( 0 );
|
Fl::pushed( 0 );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
CFRelease(text);
|
||||||
[localPool release];
|
[localPool release];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user