--- old/src/macosx/native/sun/awt/CClipboard.m 2015-03-30 18:53:23.449707800 +0300 +++ new/src/macosx/native/sun/awt/CClipboard.m 2015-03-30 18:53:23.033684000 +0300 @@ -171,6 +171,8 @@ else [args removeLastObject]; } + + - (void) checkPasteboard:(id)application { AWT_ASSERT_APPKIT_THREAD; @@ -202,6 +204,19 @@ } } +- (BOOL) checkPasteboardWithoutNotification:(id)application { + AWT_ASSERT_APPKIT_THREAD; + + NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount]; + + if (fChangeCount != newChangeCount) { + fChangeCount = newChangeCount; + return YES; + } else { + return NO; + } +} + @end /* @@ -348,16 +363,17 @@ * Method: checkPasteboard * Signature: ()V */ -JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard -(JNIEnv *env, jobject inObject ) +JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification +(JNIEnv *env, jobject inObject) { + __block BOOL ret = NO; JNF_COCOA_ENTER(env); - [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ - [[CClipboard sharedClipboard] checkPasteboard:nil]; + ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil]; }]; - + JNF_COCOA_EXIT(env); + return ret; }