src/macosx/native/sun/awt/CClipboard.m
Print this page
*** 169,178 ****
--- 169,180 ----
if (returnValue) [args replaceObjectAtIndex:0 withObject:returnValue];
else [args removeLastObject];
}
+
+
- (void) checkPasteboard:(id)application {
AWT_ASSERT_APPKIT_THREAD;
// This is called via NSApplicationDidBecomeActiveNotification.
*** 200,209 ****
--- 202,224 ----
}
}
}
}
+ - (BOOL) checkPasteboardWithoutNotification:(id)application {
+ AWT_ASSERT_APPKIT_THREAD;
+
+ NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
+
+ if (fChangeCount != newChangeCount) {
+ fChangeCount = newChangeCount;
+ return YES;
+ } else {
+ return NO;
+ }
+ }
+
@end
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: declareTypes
*** 346,363 ****
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
! JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
! (JNIEnv *env, jobject inObject )
{
JNF_COCOA_ENTER(env);
-
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
! [[CClipboard sharedClipboard] checkPasteboard:nil];
}];
JNF_COCOA_EXIT(env);
}
--- 361,379 ----
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
! 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:^(){
! ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];
JNF_COCOA_EXIT(env);
+ return ret;
}