getMainDisplay().userArea not returning correct dimensions

The following java code reports a height of 720:

        Display display = getWindowManager().getDefaultDisplay();
        Point size = new Point();
        int width = size.x;
        int height = size.y;

Yet my main component, which is set to fullscreen reports a height of 266 using the following code:

        Rectangle<int> rect(Desktop::getInstance().getDisplays().getMainDisplay().userArea);

This worked before I updated to Juce4. I was on a 3.1n branch. Anyone else noticing this?


In order to rule out an error on my part I created a blank project from scratch with the Introjucer. Same problem as before. Here's the reported screen size from the Java activity:

And here is the reported screen size from Desktop::getInstance().getDisplays().getMainDisplay()

Here is the sample project. I'm running Android 4.3 and the latest tip.


On a high-DPI display, those numbers could be correct. It's not a count of physical pixels, it can be scaled.

Thanks Jules. I can adjust accordingly.