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

Robot color picker broken on Linux with scaling above 100%

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 19
    • dev, 11, 17
    • client-libs
    • None
    • b11
    • linux

    Description

      Several tests that use Robot.getPixelColor() or createScreenCapture() fail on Linux with scaling set above 100%:
      javax/swing/JPasswordField/TestSelectedTextBackgroundColor.java
      javax/swing/JProgressBar/TestJProgressBarHighlightColor.java
      javax/swing/JSlider/TestJSliderRendering.java
      javax/swing/JSpinner/TestSelectedTextBackgroundColor.java
      javax/swing/JTextPane/TestJTextPaneBackgroundColor.java
      javax/swing/JToolTip/TestTooltipBackgroundColor.java

      The reason for failures is that the coordinates for the tested pixel are incorrect and the returned value, which is usually expected to be different because of a change in state, appears to be the same.

      There are also two tests that *should* fail for the same reason, but don't:
      java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
      java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java
      That's because the tests only check the color in the middle of a large square and, even if the coordinates are off by a few dozen pixels, the result is as expected.
      However, those two tests fail with scaling set to 300% because of an attempt to capture an image of zero size.

      Attachments

        Issue Links

          Activity

            People

              mkartashev Maxim Kartashev
              mkartashev Maxim Kartashev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: