<AWT Dev> RFR: 8144074: [PIT] Crash calling Toolkit.getScreenSize() on Windows.

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Thu Nov 26 14:38:32 UTC 2015


   There is a solution to use the default configuration width/height for 
the WToolkit.getScreenWidth()/Height() methods:
     http://cr.openjdk.java.net/~alexsch/8144074/webrev.00/

   Or we can just revert changes introduced by the JDK-JDK-8073320 to 
fix the crash only and
    address the getScreenWidth()/Height() scaling to a new issue for the 
further investigation:
     http://cr.openjdk.java.net/~alexsch/8144074/webrev-revert-00


  Thanks,
  Alexandr.

On 11/26/2015 12:00 AM, Phil Race wrote:
> No problems in that case, ie this code :-
> import java.awt.*;
>
> public class GW {
>
>
>     public static void main(String s[]) {
>         GraphicsEnvironment ge = 
> GraphicsEnvironment.getLocalGraphicsEnvironment
> ();
>         ge.getScreenDevices();
>         java.awt.Toolkit.getDefaultToolkit().getScreenSize();
>
>     }
>
> }
>
> Also I did basic checking that SwingSet still  comes up fine.
>
> -phil.
>
> On 11/25/2015 12:52 PM, Jim Graham wrote:
>> I don't see anything wrong with this and it fixes the crash so it 
>> must be better.
>>
>> The only thing I'd suggest is to verify that the new code doesn't 
>> cause problems in the case where the devices were already 
>> initialized.  If that's OK too, then I think this is a good fix.
>>
>> But hopefully someone in the AWT team can confirm that UpdateDevices 
>> is safe to call there...
>>
>> One issue to track for maybe fixing up later is if this bypasses the 
>> handling of the -Dsun.java2d.uiScale property...?
>>
>>         ...jim
>>
>> On 11/25/15 11:39 AM, Phil Race wrote:
>>> This resolves a crash on WIndows startup due to changes in the hidpi
>>> support
>>> that requires the graphics devices be initialised first in order to get
>>> screen dimensions.
>>>
>>> http://cr.openjdk.java.net/~prr/8144074/
>>> https://bugs.openjdk.java.net/browse/JDK-8144074
>>>
>>> -phil.
>



More information about the awt-dev mailing list