ok, apparently didn't commit this either. apparently includes a merge with trunk...
[blender-staging.git] / intern / ghost / intern / GHOST_WindowCocoa.mm
index dffb9b7772fe5e2b1466d4db3e51158e2e4ee698..909ba803a9dc854307c36b7dd6f16c5c4997036e 100644 (file)
@@ -153,10 +153,15 @@ extern "C" {
        else if ([[draggingPBoard types] containsObject:NSStringPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeString;
        else return NSDragOperationNone;
        
+       associatedWindow->setAcceptDragOperation(FALSE); //Drag operation needs to be accepted explicitly by the event manager
        systemCocoa->handleDraggingEvent(GHOST_kEventDraggingEntered, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
        return NSDragOperationCopy;
 }
 
+- (BOOL)wantsPeriodicDraggingUpdates
+{
+       return NO; //No need to overflow blender event queue. Events shall be sent only on changes
+}
 
 - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender
 {
@@ -174,7 +179,7 @@ extern "C" {
 
 - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender
 {
-       if (systemCocoa->canAcceptDragOperation())
+       if (associatedWindow->canAcceptDragOperation())
                return YES;
        else
                return NO;
@@ -194,7 +199,7 @@ extern "C" {
                        data = [draggingPBoard propertyListForType:NSFilenamesPboardType];
                        break;
                case GHOST_kDragnDropTypeString:
-                       data = [draggingPBoard stringForType:@"public.utf8-plain-text"];
+                       data = [draggingPBoard stringForType:NSStringPboardType];
                        break;
                default:
                        return NO;