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

GraphicsEnvironment.getMaximumWindowBounds() does not work correctly on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      SuSE 9.2:
      Linux io 2.6.8-24.11-smp #1 SMP Fri Jan 14 13:01:26 UTC 2005 i686 i686 i386 GNU/Linux

      or

      RHEL3:
      Linux dio.tomosw.bruker.de 2.4.21-27.0.2.EL #1 Wed Jan 12 23:46:37 EST
      2005 i686 i686 i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      SuSE 9,2:
      kde-config --version
      Qt: 3.3.3
      KDE: 3.3.0
      kde-config: 1.0

      or

      RHEL3:
      GNOME 2.2.2

      A DESCRIPTION OF THE PROBLEM :
      The method java.awt.GraphicsEnvironment.getMaximumWindowBounds() does not consider the task bar of KDE or GNOME as documented. Running the attached small program on a Windows machine gives the size of the desktop without the task bar which is correct. On a linux system the test program always returns the size of the root window without taking the task bar into account.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the attached test program which prints the rectangle returned from java.awt.GraphicsEnvironment.getMaximumWindowBounds().

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It is expected that the rectangle returned from java.awt.GraphicsEnvironment.getMaximumWindowBounds() gives the size of the desktop without the task bar.
      ACTUAL -
      The rectangle returned from java.awt.GraphicsEnvironment.getMaximumWindowBounds() does not take the size of the task bar into account.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;

      public class MaxWindowBounds {
          public static void main(String[] args) {
              MaxWindowBounds mwb = new MaxWindowBounds();
              JFrame frame = mwb.createFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
          }

          public MaxWindowBounds() {
          }

          public JFrame createFrame() {
              JFrame frame = new JFrame("MaxWindowBounds");
              GraphicsEnvironment env =
                  GraphicsEnvironment.getLocalGraphicsEnvironment();
              Rectangle bounds = env.getMaximumWindowBounds();
              System.out.println("bounds = "+bounds);
              return frame;
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              art Artem Ananiev
              Reporter:
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: