changeset 24447:b431e2719000

* __opengl_info__.m: Make more than one attempt to get info from hidden figure.
author John W. Eaton <jwe@octave.org>
date Thu, 21 Dec 2017 14:36:06 -0500
parents 4ca5c9f899d3
children 138c2380521c
files scripts/plot/util/__opengl_info__.m
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/__opengl_info__.m	Thu Dec 21 12:47:20 2017 -0500
+++ b/scripts/plot/util/__opengl_info__.m	Thu Dec 21 14:36:06 2017 -0500
@@ -107,15 +107,18 @@
   endfor
 
   ## If no info yet, try open a figure to get the info.
-  if (isempty (info))
+  attempts = 1;
+  while (isempty (info) && attempts++ <= 3)
     ## Need to create a figure, place an OpenGL object, and force drawing.
     hf = figure ("position", [0,0,1,1], "toolbar", "none", "menubar", "none");
     hax = axes ();
-    pause (0.1);  # FIXME: Race condition means this delay may not always work.
+    ## FIXME: Race condition means this delay may not always work.
+    pause (0.1 * attempts);
     refresh (hf);
     info = fig_gl_info (hf);
     close (hf);
-  endif
+    attempts
+  endwhile
 
   if (isempty (info))
     msg = "__opengl_info__: can not obtain OpenGL information";