justingardner / mgl

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

Failure to open a window on dual display #49

Closed justingardner closed 2 years ago

justingardner commented 2 years ago

On a dual display system (e.g. monitor hooked up to a laptop), when I start the mglRenderingDemo, it says the following for the first demo and does not open a window. If I hit cntrl-c it goes on to the next demo and everything works fine. Note that there is no mglMetal process running when I get the message below - maybe this is some race condition?


mglRenderingDemo

Running 21 demos. (mglPrivateListener) Starting keyboard and mouse event tap. End with mglListener('quit').

ans =

0x0 empty cell array

1: Hit any key to continue for mglTestClearScreen.

(mglMetalExecutableName) Using mglMetal app at /Users/justin/proj/mgl/metal/binary/stable/mglMetal.app (mglMetalOpen) mglMetal executable is already running (mglMetalShutdown) Shutting down mglMetal process: ..........................................

justingardner commented 2 years ago

This seems to have been an issue with mglMetalIsRunning - this would return true even if mglMetal was not running - seems to happen because of weird behavior of the matlab system command which returns things that are in the text buffer - i.e. the command was trying to do a ps to check if mglMetal was running and checked if the return was empty, but instead it was full of the next few commands the user was going to run. Fixed it to check for the string mglMetal.app and that seems to have fixed it.