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

GraphicsEnvironment does not detect changes in count of monitors on Linux OS

    XMLWordPrintable

Details

    • b08
    • generic
    • linux

    Backports

      Description

        FULL PRODUCT VERSION :
        JDK 9, JDK 8u40, JDK 7u76

        ADDITIONAL OS VERSION INFORMATION :
        Ubuntu 14.04 OS

        A DESCRIPTION OF THE PROBLEM :
        On Linux OS the method "java.awt.GraphicsEnvironment.getScreenDevices()" returns wrong number of "java.awt.GraphicsDevice" objects after an additional monitor is plugged in or plugged out.

        For example, on the system with two monitors the attached test case produces the following output.

        Scenario #1 – The additional monitor is plugged out:
        These monitors correctly recognized when Java started:
        :0.0 1280x1024 0,0/1280x1024
        :0.1 1920x1200 1280,0/1920x1200
        But after plugging out the monitor Java returns wrong array:
        :0.0 1280x1024 0,0/1280x1024 <-- this one actually does not exist
        :0.1 1920x1200 1280,0/1920x1200

        Scenario #2 – The additional monitor is plugged in:
        Default monitor correctly recognized when Java started:
        :0.0 1920x1200 0,0/1920x1200
        But after plugging in the monitor Java returns wrong array:
        :0.0 1280x1024 0,0/3200x1200 <-- 2 screens joined into 1 pseudo-screen

        The issue is not reproducible on OS X and MS Windows OS.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Scenario #1:
        1. Plug in the additional monitor.
        2. Compile and run the test case attached to the bug as "GetScreenDevicesReturnsIncorrectResult.java" file with JDK to be tested.
        3. In the test case window click "LOG" button and verify that all monitors available in the OS became listed in the test case window.
        4. Plug out the additional monitor.
        5. In the test case window click "LOG" button. The bug is reproduced, if the plugged out monitor still became listed in the test case window.

        Scenario #2:
        1. Plug out the additional monitor.
        2. Compile and run the test case attached to the bug as "GetScreenDevicesReturnsIncorrectResult.java" file with JDK to be tested.
        3. In the test case window click "LOG" button and verify that the plugged out monitor did not become listed in the test case window.
        4. Plug in the additional monitor.
        5. In the test case window click "LOG" button. The bug is reproduced, if the plugged in monitor still did not become listed in the test case window.

        Attachments

          Issue Links

            Activity

              People

                serb Sergey Bylokhov
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: