justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

Test screen params produces NSAlert when privacy setting are not set #5

Closed steevelaquitaine closed 9 years ago

steevelaquitaine commented 9 years ago

When calling mglEditScreenParams and running Test screen params we get this error:

MATLAB_maci64[4321:208830] NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Break on void _NSAlertWarnUnsafeBackgroundThreadUsage() to debug. This will be logged only once. This may break in the future.

Terminated: 15

NSAlert is called in the mglListener code which handles keyboard events - it sets an NSAlert to tell you to set the privacy settings (have accessibility for the terminal enabled) if you haven’t done so.

We should change that if it is no longer supported to call that from a background thread.

justingardner commented 9 years ago

Ok. This should be fixed now. initScreen calls a function mglSystemCheck to test whether there are issues and handles it separately from other code, getting rid of the NSAlert in the background thread.