Modify ExecuteEvent to make it work with OpenGL.
(From Anna)