I want to know if my app/component is on a retina display or not (say to paint things differently for instance).
But the user can have a main retina display, plus an external non-retina display, and move the app between them.
Is there any smart trick, a callback or something that I can use to be told when the display I’m on is changing?
I could use a timer, and regularly check the current one with something like that :
yes sure, actually I had done exactly that in another plugin a few weeks ago, just forgot
But I was hoping for a kind of display change listener mechanism so that I’m told when the display change and avoid checking. but yes, that will do
Yes. We are working on fixing a lot of scaling issues including having JUCE apps respond to when the user changes the scale at runtime (windows/linux). That will definitely need some kind of callback mechanism. For now use the ComponentListener.
Did you ever find a solution for this that didn’t involve polling? We allocate openGL textures and images based on the scale factor, so it’d be really nice to have a better mechanism to handle these changes.