Robot.getPixelColor() may return stale pixels due to missing Toolkit.sync()

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 8, 11, 17, 21, 25, 27
    • Component/s: client-libs
    • generic
    • generic

      Robot.getPixelColor() does not call Toolkit.getDefaultToolkit().sync() before reading the pixel, unlike Robot.createScreenCapture() which has had this call since JDK-6725214.

      When a hardware-accelerated pipeline (OGL, D3D, Metal) is active, rendering may be buffered and not yet flushed to the screen when getPixelColor() reads the pixel. This causes it to return stale values typically the window background color instead of the rendered content.

            Assignee:
            Sergey Bylokhov
            Reporter:
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: