On Mon, 29 Jan 2024 14:24:43 GMT, Christoph Langer <clan...@openjdk.org> wrote:
> The assertions reported in the bug were observed spuriously and here and > there broke tests in some Windows configurations. > For instance [JDK-8266129](https://bugs.openjdk.org/browse/JDK-8266129), > [JDK-8269529](https://bugs.openjdk.org/browse/JDK-8269529) or > [JDK-8323664](https://bugs.openjdk.org/browse/JDK-8323664) came up due to > this. > > The problem is that in Windows environments without a valid display, e.g. > started by system services or via PowerShell Remoting, one sees a Monitor > with name 'Windisc' in `EnumDisplayMonitors`. > However, it seems to be some kind of a pseudo device where you can not get a > DC via `CreateDC`. This behavior/monitor type doesn't seem to be well > documented, though. > > I hereby modify the device initialization code to only count/detect monitors > where CreateDC returns non-NULL in Devices.cpp. I also add some more > checking/error handling to AwtWin32GraphicsDevice::Initialize() for > correctness. > > Furthermore, I re-enable the test > `javax/swing/reliability/HangDuringStaticInitialization.java` for Windows > Debug VMs, which reverts the fix from JDK-8269529 that should not be > necessary any more. This pull request has now been integrated. Changeset: 1ad3ebcf Author: Christoph Langer <clan...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/1ad3ebcf11834ec1d119ee95c858d98fb7bc6e68 Stats: 149 lines in 9 files changed: 89 ins; 25 del; 35 mod 8185862: AWT Assertion Failure in ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0) 'awt_Win32GraphicsDevice.cpp', at line 185 Reviewed-by: aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/17614