On Wed, 18 Feb 2026 08:24:22 GMT, Sergey Bylokhov <[email protected]> wrote:

> Robot.getPixelColor() does not call Toolkit.getDefaultToolkit().sync() before 
> reading the pixel, unlike Robot.createScreenCapture() which has had this call 
> since [JDK-6725214](https://bugs.openjdk.org/browse/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.

This pull request has now been integrated.

Changeset: 497dca25
Author:    Sergey Bylokhov <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/497dca2549a9829530670576115bf4b8fab386b3
Stats:     4 lines in 1 file changed: 3 ins; 0 del; 1 mod

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

Reviewed-by: prr, azvegint

-------------

PR: https://git.openjdk.org/jdk/pull/29780

Reply via email to