<AWT Dev> [9] Review request for 8170386: JLightweightFrame content can miss paint events on Windows

Semyon Sadetsky semyon.sadetsky at oracle.com
Tue Nov 29 17:00:03 UTC 2016

On 11/29/2016 6:24 PM, Sergey Bylokhov wrote:
> On 29.11.16 17:35, Semyon Sadetsky wrote:
>> Paint event may be missed by the JLightweightFrame on Windows platform
>> when it is resized consequently to the same size because the latter sets
>> paintPainding flag .
> From what place the Paint will be posted after the call to 
> setBounds()? In case of normal native components this event will be 
> posted from native code after the size of the native component will be 
> changed. But how it works in case of JLightweightFrame? At least 
> COMPONENT_MOVED/COMPONENT_RESIZED are posted manually from the 
> reshape() method, probably we should do the same for the PAIN event as 
> well? In this case our optimization which coalesce PAINT events will 
> work and the sequence of setBounds() will produce only one repaint() 
> action.
Paint event is posted on resize and handled as usual in case of 
JLightweightFrame, but the paint handler does not initiate the real 
paint when paintPainding is true for optimization purpose because it 
detects that the consequent paint event has been posted already.
>> The fix overrides WComponentPeer#setBounds() method in
>> WLightweightFramePeer to clears paintPainding flag.

More information about the awt-dev mailing list