src/macosx/native/sun/awt/AWTWindow.m
Print this page
@@ -603,53 +603,28 @@
}
(*env)->DeleteLocalRef(env, platformWindow);
}
}
-
- (void)windowWillEnterFullScreen:(NSNotification *)notification {
- static JNF_MEMBER_CACHE(jm_windowWillEnterFullScreen, jc_CPlatformWindow, "windowWillEnterFullScreen", "()V");
JNIEnv *env = [ThreadUtilities getJNIEnv];
- jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
- if (platformWindow != NULL) {
- JNFCallVoidMethod(env, platformWindow, jm_windowWillEnterFullScreen);
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_WILL_ENTER withEnv:env];
- (*env)->DeleteLocalRef(env, platformWindow);
- }
}
- (void)windowDidEnterFullScreen:(NSNotification *)notification {
- static JNF_MEMBER_CACHE(jm_windowDidEnterFullScreen, jc_CPlatformWindow, "windowDidEnterFullScreen", "()V");
JNIEnv *env = [ThreadUtilities getJNIEnv];
- jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
- if (platformWindow != NULL) {
- JNFCallVoidMethod(env, platformWindow, jm_windowDidEnterFullScreen);
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER withEnv:env];
- (*env)->DeleteLocalRef(env, platformWindow);
- }
}
- (void)windowWillExitFullScreen:(NSNotification *)notification {
- static JNF_MEMBER_CACHE(jm_windowWillExitFullScreen, jc_CPlatformWindow, "windowWillExitFullScreen", "()V");
JNIEnv *env = [ThreadUtilities getJNIEnv];
- jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
- if (platformWindow != NULL) {
- JNFCallVoidMethod(env, platformWindow, jm_windowWillExitFullScreen);
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_WILL_EXIT withEnv:env];
- (*env)->DeleteLocalRef(env, platformWindow);
- }
}
- (void)windowDidExitFullScreen:(NSNotification *)notification {
- static JNF_MEMBER_CACHE(jm_windowDidExitFullScreen, jc_CPlatformWindow, "windowDidExitFullScreen", "()V");
JNIEnv *env = [ThreadUtilities getJNIEnv];
- jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
- if (platformWindow != NULL) {
- JNFCallVoidMethod(env, platformWindow, jm_windowDidExitFullScreen);
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT withEnv:env];
- (*env)->DeleteLocalRef(env, platformWindow);
- }
}
- (void)sendEvent:(NSEvent *)event {
if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) {
@@ -836,17 +811,16 @@
(JNIEnv *env, jclass clazz, jlong windowPtr)
{
jobject ret = NULL;
JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr);
__block NSRect contentRect = NSZeroRect;
__block NSRect frame = NSZeroRect;
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
frame = [nsWindow frame];
contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]];
}];