JDK-8256465 : [macos] Java frame and dialog presented full screen freeze application
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2020-11-16
  • Updated: 2021-06-11
  • Resolved: 2021-06-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b26Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Mac OS Big Sur

A DESCRIPTION OF THE PROBLEM :
On the latest Mac OS Big Sur I have a Swing frame which shows a Swing Dialog. If I switch the Swing frame to full screen and then show the dialog, the dialog is also full screen and the user interface freezes.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Show a Swing frame, maximize it to full screen, from the frame show a dialog.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Showing the dialog should not freeze the entire application.
ACTUAL -
I can no longer close the dialog or switch to the main frame.

---------- BEGIN SOURCE ----------
    JFrame fr = new JFrame("abc");
    fr.setSize(500, 500);
    fr.getContentPane().add(new JButton(new AbstractAction("TEST") {
      
      @Override
      public void actionPerformed(ActionEvent e) {
        JDialog dlg = new JDialog(fr, false);
        dlg.setSize(500, 500);
        dlg.getContentPane().add(new JTextArea());
        dlg.setVisible(true);
      }
    }));
    fr.setVisible(true);
  }
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Unfortunately the method "com.apple.eawt.FullScreenUtilities.setWindowCanFullScreen" does not seem to work anymore so the only workaround I have is to set the entire frame as not resizable: frame.setResizable(false);

FREQUENCY : always



Comments
Changeset: 042f0bdb Author: Tejpal Rebari <trebari@openjdk.org> Date: 2021-06-06 04:08:05 +0000 URL: https://git.openjdk.java.net/jdk/commit/042f0bdb3568edab4f96b9f7c83cbb0f90db7f18
06-06-2021

Created a native program with button and Alert, On macos 11 the alert is always opening in new Windows with all the prefer tabs options. Attaching screenshot of the same.
30-03-2021

When we set Preferences -> General -> "Prefer tabs" to "never". It doesn't freeze in Full Screen and without the full screen.
04-12-2020

I verified that this issue exists on macOS Big Sur.
24-11-2020

I also have a customer who's complaining badly about this issue. I reproduced it on my Big Sur laptop with the attached code without problems. It freezes without fullscreen as well, when you set Preferences -> General -> "Prefer tabs" to "always". I changed priority to 3 and fix version to 16 because I hope this issue can be fixed soon. Thanks.
20-11-2020

Checked with attached test program on Darwin, did not observe any freeze. Don't have BigSur to review, Moving to JDK to review on MacOS-BigSur
17-11-2020