< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m

Print this page

        

*** 883,904 **** NSPoint p = [NSEvent mouseLocation]; NSRect frame = [self.nsWindow frame]; NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame]; - // Check if the click happened in the non-client area (title bar) - if (p.y >= (frame.origin.y + contentRect.size.height)) { JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; if (platformWindow != NULL) { // Currently, no need to deliver the whole NSEvent. static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V"); JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown); - (*env)->DeleteLocalRef(env, platformWindow); } } } } - (void)constrainSize:(NSSize*)size { float minWidth = 0.f, minHeight = 0.f; --- 883,912 ---- NSPoint p = [NSEvent mouseLocation]; NSRect frame = [self.nsWindow frame]; NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame]; JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; + + // Check if the click happened in the non-client area (title bar) + if (p.y >= (frame.origin.y + contentRect.size.height)) { if (platformWindow != NULL) { + // Toggle full screen upon double click on title bar. + if([event clickCount] == 2) { + static JNF_MEMBER_CACHE(jm_deliverNCDblClick, jc_CPlatformWindow, "deliverNCDblClick", "()V"); + JNFCallVoidMethod(env, platformWindow, jm_deliverNCDblClick); + } else { // Currently, no need to deliver the whole NSEvent. static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V"); JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown); } } } + + (*env)->DeleteLocalRef(env, platformWindow); + } } - (void)constrainSize:(NSSize*)size { float minWidth = 0.f, minHeight = 0.f;
< prev index next >