<AWT Dev> RFR: 8272481: [macos] javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java fails [v2]
Sergey Bylokhov
serb at openjdk.java.net
Mon Aug 23 21:23:26 UTC 2021
On Mon, 23 Aug 2021 17:57:45 GMT, Alexey Ushakov <avu at openjdk.org> wrote:
>> Update opacity only if the component is visible
>
> Alexey Ushakov has updated the pull request incrementally with one additional commit since the last revision:
>
> 8272481: [macos] javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java fails
>
> Update window layer opacity to align with the peer translucency
src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformView.java line 70:
> 68: if (peer.isTranslucent()) {
> 69: this.windowLayer.setOpaque(false);
> 70: }
Do we still need the " if (isVisible())" check in the LWWindowPeer.java?
I would like to double-check the reason we need the code above:
* All our opaque properties are true by default(this is the properties used inside isTranslucent() method)
* If any of the properties are actually set to false by the user, then we will reset the property of the layer to NO
* The shape property will trigger: LWWindowPeer->applyShapeImpl->updateOpaque->getPlatformWindow().setOpaque(!isTranslucent());
* The opaque property will trigger: LWWindowPeer->setOpaque->updateOpaque->getPlatformWindow().setOpaque(!isTranslucent());
And the only problematic property is textured:
* During initialisation we call "peer.setTextured" from the getInitialStyleBits(), this is before we call contentView.initialize inside CPlatformWindow.initialize(). I think we should move the call "peer.setTextured" to the CPlatformWindow.java:337 after contentView.initialize() This is same as DECORATED property is used in the same method.
* If the textured property is changed after initialisation we did not update the "java" textuted property. See ClientPropertyApplicator:
new Property<CPlatformWindow>(WINDOW_BRUSH_METAL_LOOK) { public void applyProperty(final CPlatformWindow c, final Object value) {
c.setStyleBits(TEXTURED, Boolean.parseBoolean(value.toString()));
}},
-------------
PR: https://git.openjdk.java.net/jdk/pull/5172
More information about the awt-dev
mailing list