Is there any Display resolution change listener?

Probably it is very rarely when users change display resolution, but even though it is rare I still would like to manage such situation. Which I mean to resize my plugin dependently on display new height.

So it seems like I need to make my resizable corner, or plugin constrainer to listen such resolution changes. But can find the way how to do that.

I have also one more related question. I see that:

const int displayHeight = Desktop::getInstance()

depends on display resolution at least on OSX. Does it behave the same way on Windows? At the moment I am not able to test it on Windows.

For any help great thanks in advance.
Best regards.

I don’t understand why. When a user changes resolution, don’t they want everything to change size? It’s the effect they wanted, and it’s expected.


 setResizable (true, true);
 setResizeLimits (, , , );

… Are the resizing initialisers, so the user can change sizes by themselves.
See the AccessibilityDemo, I believe it gives an example.
But I’m not sure that’s what you wanted.

1 Like

Hello Dave, thanks for your reply.

Few times my clients claimed that accidentally my plugin was resized out of display bounds, and the resizing corner (in my case in right bottom corner) was outside of the display and it was unaccessable, and they can’t resize plugin. Of course it was only few times (once or maybe two) but I want to avoid that. Thats why I added limit in my plugin editor to set max height of my plugin to be no more then:

const int maxHeight = roundToInt(static_cast<float>(Desktop::getInstance()
                           .getPrimaryDisplay()->userArea.getHeight()) * 0.95f);

But I can imagine situation that user has changed the resolution of his display. And I would like to get info about that and (if needed) make my plugin smaller to fit the new size of display.

Oh, I see. Why not just call ‘setSize’ after loading up and checking current bounds. Resized is then called for you. And I guess you could check the bounds every time it’s drawn?

Ha ha ha. Thanks. Sometimes such simplest solutions are the best but I can’t find them while I am bothered by looking of some extra sophisticated solutions. :slight_smile:

Thanks again.