Get screen-width / -height from inside an audio plugin?

Hi !

I wonder if there is an easy way to obtain actual screen size / resoultion from inside an audio plugin ?
Since I have a small resolution on my mac book pro and “full hd” one on my windows pc, i thought about
not giving default pixel sizes for initial plugin width/height but rather calculate them proportionally
to screen size.

Which class / method is a good starting point ?

Thanks in advance,


ah ok, i see :slight_smile:

in case anyone else is interested, i used it like this :

	Rectangle<int> r = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
	int x = r.getWidth();
	int y = r.getHeight();

thanks, jules !


For any newer developers with the same question, the new way to do this is with:

const juce::Displays::Display* screen = Desktop::getInstance().getDisplays().getPrimaryDisplay();

And be sure to check for nullptr before using it!