platformWidth

John Hendrikx hjohn at xs4all.nl
Thu Jun 3 21:38:12 UTC 2021


Perhaps an example will help from my machine.

I'm running on a 4k screen at 150% scaling. These are the values:

outputScaleX = 1.5
outputScaleY = 1.5
platformScaleX = 1.5
platformScaleY = 1.5
width = 2560
height = 1440
visibleWidth = 2560
visibleHeight = 1400
platformWidth = 3840
platformHeight = 2160

So it seems that platform values report the actual resolution of the 
Screen / Monitor. Probably they're what is being reported by Windows and 
stored there by JavaFX to derive the actual width/height it should use 
while taking scaling into account.

You didn't ask about the difference between visibleHeight and height. 
But just incase, the visibleHeight is 40 pixels smaller than height, as 
this space is taken up by the task bar.

--John


On 01/06/2021 13:27, Johan Vos wrote:
> Hi,
>
> com.sun.glass.ui.Screen has 3 width (and height) parameters, each with a
> getter:
> * width
> * visibleWidth
> * platformWidth
>
> The latter seems to be used only in the windows build,
> via screen.containsPlatformRect and screen.portionIntersectsPlatformRect
>
> I don't really understand what the goal of this platformWidth/Height is. It
> seems a bit artificial if this is not used on the other platforms, but I
> might be missing the bigger purpose of this?
>
> - Johan
>


More information about the openjfx-dev mailing list