Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8041734

JFrame in full screen mode leaves empty workspace after close

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7-pool, 8-pool, 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Subcomponent:
    • Resolved In Build:
      b36
    • OS:
      os_x

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0-ea"
        Java(TM) SE Runtime Environment (build 1.8.0-ea-b120)
        Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Mac OS X 10.9

        A DESCRIPTION OF THE PROBLEM :
        The problem reproduces on both JDKs 1.7.0_45 and 1.8.0-ea-b120

        If you have two or more JFrames in full screen mode and close one of the frames, there will be an empty grey screen and empty toolbar menu.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Open IntelliJ IDEA
        2. Open two or more projects
        3. Send all windows to full screen
        4. Close one of the projects by Main Menu -> File -> Close project

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Empty workspace should be removed from available spaces.
        ACTUAL -
        Grey empty screen

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.*;
        import java.awt.*;
        import java.awt.event.ActionEvent;
        import java.awt.event.ActionListener;
        import java.lang.reflect.Method;

        /**
         * @author Konstantin Bulenkov
         */
        public class MacWorkspacesBug extends JFrame {
          public MacWorkspacesBug(String title) throws HeadlessException {
            super(title);
            setSize(500, 500);

            final JButton close = new JButton("Close");
            close.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                setVisible(false);
              }
            });
            getContentPane().add(close);
          }

          public static void enableOSXFullscreen(Window window) {
            try {
              Class<?> util = Class.forName("com.apple.eawt.FullScreenUtilities");
              Method method = util.getMethod("setWindowCanFullScreen", Window.class, Boolean.TYPE);
              method.invoke(util, window, true);
            } catch (Exception ignore) {
            }
          }

          public static void main(String[] args) {
            final MacWorkspacesBug f1 = new MacWorkspacesBug("Frame 1");
            final MacWorkspacesBug f2 = new MacWorkspacesBug("Frame 2");
            enableOSXFullscreen(f1);
            enableOSXFullscreen(f2);
            f1.setVisible(true);
            f2.setVisible(true);
          }
        }

        ---------- END SOURCE ----------

          Issue Links

            Activity

            Hide
            serb Sergey Bylokhov added a comment -
            I rechecked FX behaviour, and it works in the same way as if I call toggle before orderout. It is different from jdk 6 or native.
            Show
            serb Sergey Bylokhov added a comment - I rechecked FX behaviour, and it works in the same way as if I call toggle before orderout. It is different from jdk 6 or native.
            Hide
            anthony Anthony Petrov (Inactive) added a comment -
            Oh, well. Nobody complained yet. Anyway, if you can improve this behavior in JDK, this is fine. In that case, I'd also ask you to file a P4 Tweak issue against Glass to implement a similar solution for JavaFX. Thanks in advance.
            Show
            anthony Anthony Petrov (Inactive) added a comment - Oh, well. Nobody complained yet. Anyway, if you can improve this behavior in JDK, this is fine. In that case, I'd also ask you to file a P4 Tweak issue against Glass to implement a similar solution for JavaFX. Thanks in advance.
            Show
            serb Sergey Bylokhov added a comment - https://code.google.com/p/chromium/issues/detail?id=156101
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/54afdf196017
            User: serb
            Date: 2014-09-23 18:43:36 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/54afdf196017 User: serb Date: 2014-09-23 18:43:36 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/54afdf196017
            User: lana
            Date: 2014-10-22 18:55:37 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/54afdf196017 User: lana Date: 2014-10-22 18:55:37 +0000

              People

              • Assignee:
                serb Sergey Bylokhov
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: