Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8256465: [macos] Java frame and dialog presented full screen freeze application #3407

Closed
wants to merge 13 commits into from
@@ -126,6 +126,9 @@ private static native void nativeSetNSWindowStandardFrame(long nsWindowPtr,
public static final String WINDOW_FULL_CONTENT = "apple.awt.fullWindowContent";
public static final String WINDOW_TRANSPARENT_TITLE_BAR = "apple.awt.transparentTitleBar";
public static final String WINDOW_TITLE_VISIBLE = "apple.awt.windowTitleVisible";

// This system property is used in javafx as well
trebari marked this conversation as resolved.
Show resolved Hide resolved
public static final String MAC_OS_TABBED_WINDOW = System.getProperty("jdk.allowMacOSTabbedWindows");
trebari marked this conversation as resolved.
Show resolved Hide resolved
public static boolean allowMacOSAutomaticWindowTabbing;

// Yeah, I know. But it's easier to deal with ints from JNI
@@ -195,7 +198,7 @@ static boolean IS(final int bits, final int mask) {
AccessController.doPrivileged(
(PrivilegedAction<Object>) () -> {
allowMacOSAutomaticWindowTabbing = Boolean.parseBoolean(
System.getProperty("jdk.allowMacOSTabbedWindows"));
MAC_OS_TABBED_WINDOW);
return null;
});
nativeSetAllowAutomaticTabbingProperty(allowMacOSAutomaticWindowTabbing);
@@ -1103,11 +1103,13 @@ + (AWTWindow *) lastKeyWindow {
(JNIEnv *env, jclass clazz, jboolean allowAutomaticTabbing)
{
JNI_COCOA_ENTER(env);
if (allowAutomaticTabbing) {
[NSWindow setAllowsAutomaticWindowTabbing:YES];
} else {
[NSWindow setAllowsAutomaticWindowTabbing:NO];
}
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
if (allowAutomaticTabbing) {
[NSWindow setAllowsAutomaticWindowTabbing:YES];
} else {
[NSWindow setAllowsAutomaticWindowTabbing:NO];
}
}];
JNI_COCOA_EXIT(env);
}