Main Display scale in worker thread


#1

Hi Jules,

 

When loading some resource in a worker thread, I would like to get the current display scale. (in order to know if I load retina assets or not)

Currently if I call Desktop::Displays::getMainDisplay() in another thread to get this scale, I got an assert.

 

Is this assert mandatory, or some locking would help avoiding it ?

 

Thanks,


#2

The display structure could be updated at any time by the message thread, so you'd need to use a MessageManagerLock to read it safely.


#3

oki doki

 

Thanks !