<Swing Dev> [13] RFR JDK-8213535:Windows HiDPI html lightweight tooltips are truncated

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Mon Apr 6 06:08:06 UTC 2020


On 05-Apr-20 10:29 AM, Sergey Bylokhov wrote:
> On 4/2/20 8:59 pm, Prasanta Sadhukhan wrote:
>
>>> If we GC is correct in reset/pack step, but the View calculate wrong 
>>> size(and update it only after "graphicsConfiguration" property 
>>> change) means that we calculate the size of the View using wrong GC, 
>>> why?
>>
>> It's not the size of View, it's the preferredSize that is wrong. This 
>> is because tip's GC is null before the tip is shown, so View's span 
>> is calculated accordingly. Only when View isupdated when 
>> "graphicsConfiguration" is fired, then Tooltip GC is updated and 
>> preferredSpan is calculated correctly.
>>
>> It's to be remembered that the issue happens only when html text is 
>> shown in ToolTip. If normal text is shown , there is no issue. I 
>> guess if it's a question of wrong GC during popup reset/pack, then it 
>> will cause problem during normal text rendering also, no?
>
> If GC of the tip is null before showing then can we use default screen 
> GC by default? Same as in the java.awt.Window.initGC().

I tried but SwingUtilities.windowForComponent(tip) returns null so there 
is no "Window" parent associated with tooltip so initGC() cannot be 
called on tip, as I see.

Also, tip GC is null for normal text too, where it works. Only 
difference between normal and html text is in calculation of 
getPreferredSize/MaximumSize/MinimumSize where the size is updated based 
on updated span calculation, so I have used updated preferredSize in my fix.

Regards
Prasanta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200406/0ad91172/attachment.htm>


More information about the swing-dev mailing list