On Thu, 13 Aug 2026 05:35:25 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Check for headless
>
> src/java.desktop/share/classes/javax/swing/JComponent.java line 4199:
> 
>> 4197:         } else if ("dragEnabled".equals(propertyName)
>> 4198:                 && this instanceof JTextComponent textComponent) {
>> 4199:             if (!GraphicsEnvironment.isHeadless()) {
> 
> You have dropped the "GraphicsEnvironment.isHeadless" check in 
> uninstallDefaults but left it in installDefaults, I assume that after this 
> change the check in Aqua is not needed in both?

Yes, logically Aqua installDefaults() headless check is now redundant but I 
kept the Aqua check as a local guard: Aqua is the code requesting true, and it 
documents why headless creation remains safe. 
No headless check is needed in Aqua uninstallDefaults() where we have
`LookAndFeel.installProperty(getComponent(), "dragEnabled", oldDragState);`
as in headless mode, `oldDragState `will be false, so there is no possible 
HeadlessException; and with the current setUIProperty guard it will simply be 
ignored anyway.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32101#discussion_r3772945717

Reply via email to