--- old/src/macosx/native/sun/awt/CDragSource.m 2013-02-27 17:02:18.000000000 +0400 +++ new/src/macosx/native/sun/awt/CDragSource.m 2013-02-27 17:02:18.000000000 +0400 @@ -84,10 +84,10 @@ return sCurrentDragSource; } -- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control +- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent control:(id)control transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount - timeStamp:(jlong)timeStamp cursor:(jobject)jcursor + timeStamp:(jlong)timeStamp dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap { @@ -101,12 +101,10 @@ if (control != nil) { JNIEnv *env = [ThreadUtilities getJNIEnv]; fComponent = JNFNewGlobalRef(env, jcomponent); - fComponentPeer = JNFNewGlobalRef(env, jpeer); fDragSourceContextPeer = JNFNewGlobalRef(env, jdragsourcecontextpeer); fTransferable = JNFNewGlobalRef(env, jtransferable); fTriggerEvent = JNFNewGlobalRef(env, jtrigger); - fCursor = JNFNewGlobalRef(env, jcursor); if (jnsdragimage) { JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J"); @@ -129,9 +127,8 @@ // Set this object as a dragging source: - AWTView *awtView = [((NSWindow *) control) contentView]; - fView = [awtView retain]; - [awtView setDragSource:self]; + fView = [(AWTView *) control retain]; + [fView setDragSource:self]; // Let AWTEvent know Java drag is getting underway: [NSEvent javaDraggingBegin]; @@ -158,11 +155,6 @@ fComponent = NULL; } - if (fComponentPeer != NULL) { - JNFDeleteGlobalRef(env, fComponentPeer); - fComponentPeer = NULL; - } - if (fDragSourceContextPeer != NULL) { JNFDeleteGlobalRef(env, fDragSourceContextPeer); fDragSourceContextPeer = NULL; @@ -178,11 +170,6 @@ fTriggerEvent = NULL; } - if (fCursor != NULL) { - JNFDeleteGlobalRef(env, fCursor); - fCursor = NULL; - } - if (fFormats != NULL) { JNFDeleteGlobalRef(env, fFormats); fFormats = NULL; @@ -586,11 +573,6 @@ { AWT_ASSERT_NOT_APPKIT_THREAD; - // Set the drag cursor (or not 3839999) - //JNIEnv *env = [ThreadUtilities getJNIEnv]; - //jobject gCursor = JNFNewGlobalRef(env, fCursor); - //[EventFactory setJavaCursor:gCursor withEnv:env]; - [self performSelectorOnMainThread:@selector(doDrag) withObject:nil waitUntilDone:YES]; // AWT_THREADING Safe (called from unique asynchronous thread) }