From 14cd8e9174b80a1f9c5ef92c273c0558d97ae79e Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 13 Jun 2009 01:11:45 +0000 Subject: Attempt to get disableBackgroundErase hack working again with 6u10+, but despite calling method, still see flickering with 6u13 git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1938 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index a23263a8f..a510efc10 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -661,10 +661,17 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { - disableBackgroundEraseMethod = - getToolkit().getClass().getDeclaredMethod("disableBackgroundErase", - new Class[] { Canvas.class }); - disableBackgroundEraseMethod.setAccessible(true); + Class clazz = getToolkit().getClass(); + while (clazz != null && disableBackgroundEraseMethod == null) { + try { + disableBackgroundEraseMethod = + clazz.getDeclaredMethod("disableBackgroundErase", + new Class[] { Canvas.class }); + disableBackgroundEraseMethod.setAccessible(true); + } catch (Exception e) { + clazz = clazz.getSuperclass(); + } + } } catch (Exception e) { } return null; -- cgit v1.2.3