<AWT Dev> RFR: 8267430: GraphicsDevice.setDisplayMode(REFRESH_RATE_UNKNOWN) throws AE: Unable to set display mode! [v2]

Phil Race prr at openjdk.java.net
Mon Jun 7 20:22:46 UTC 2021


On Mon, 7 Jun 2021 19:45:49 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8267430: GraphicsDevice.setDisplayMode(REFRESH_RATE_UNKNOWN) throws IAE: Unable to set display mode
>
> src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java line 72:
> 
>> 70:     public CGraphicsDevice(final int displayID) {
>> 71:         this.displayID = displayID;
>> 72:         this.initialMode = getDisplayMode();
> 
> This probably should be revalidated when this device is invalidated, otherwise deleted device will restore its own old-initial mode, instead of the new-mode for the new device.

Ok I've added copying it in invalidate()

> src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java line 341:
> 
>> 339:                  * that mode reported and it restores all devices, but
>> 340:                  * this seems a better compromise than failing to restore
>> 341:                  */
> 
> Would like to highlight that this tradeoff will break the spec, since we successfully restore the mode which is not in the list of modes.

So .. it was in the lsit of modes that the app was handed, and it is a bug that it isn't still there.
But what I've just done is fixed getDIsplayModes() to  include it

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

PR: https://git.openjdk.java.net/jdk/pull/4373


More information about the awt-dev mailing list