On Fri, 31 Mar 2023 09:11:20 GMT, Dmitry Cherepanov <[email protected]> 
wrote:

> Please review this PR which suggests to skip updateIconImages() for not yet 
> visible windows. The displayChanged notification can be sent to a window that 
> is in the process of initiailization and calling updateIconImages() may lead 
> to the deadlock.
> 
> Testing: the deadlock no longer happens with this patch. The reg test for 
> JDK-8276849 works (window icon is updated after changing DPI settings).

No objections to a safe fix for this, but the app is creating and - more to the 
point - showing (setVisible) the AWT window on the main thread.
Even for AWT (non-swing) apps, it is recommended to do it on the EDT to avoid 
threading issues - such as this.
Lots of apps do use the main thread, and have no issues but that's not 
guaranteed.

I can't find where this is documented .. I do remember it was quite a number of 
years ago that this advice was first offered. 

I suppose you could not create a reliable test for this ? Please add noreg-hard 
to the bug.

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

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13263#pullrequestreview-1367407739

Reply via email to