|Close one GLCanvas and other GLCanvas goes blank on Mac [message #968557]
||Fri, 02 November 2012 14:57
| pb irish
Registered: November 2012
I'm new to the project that I am working on and new to JOGL/Open GL, so I will do my best to describe the problem with enough information to be useful. The problem seems to be related to SWT and/or JOGL issues on Mac, so I posted the question here and on a JOGL forum hoping it strikes a chord with someone.|
Our application runs on Linux, Windows, and Mac (not sure of the exact version of the Mac OS) and this problem only occurs on Mac machines.
The application creates multiple instances of FormEditors (org.eclipse.ui.forms.editor.FormEditor). Each FormEditor instance contains an instance of a FormPage (org.eclipse.ui.forms.editor.FormPage) which contains an instance of GLCanvas. When one editor is closed, the GLCanvas on all other open editors goes blank. When another editor is opened, the previously open editors are redrawn.
To be a little more precise without going into extensive detail, the FormPage contains a ScrolledForm (org.eclipse.ui.forms.ScrolledForm). The Composite returned from ScrolledForm.getBody(), is passed to FormToolkit.createComposite() to create a Composite which is passed to the GLCanvas constructor to finally result in a GLCanvas instance.
I was able to debug the problem to a point. When the FormEditor is closed, the progression of disposing of the FormEditor children eventually leads to the GLCanvas.SWTDispose event handler being fired. Within the handler, setData() is called. Within org.eclipse.swt.widgets.widget.setData(), setOpenGLContext is called. Within org.eclipse.swt.widgets.widget.setOpenGLContext(), the code gets an NSWindow from view.window (I believe that view is an instance of org.eclipse.swt.internal.cocoa.SWTCanvasView). The code calls setOpaque(true) on the NSWindow, and the GLCanvas in all editors go blank. If I open a new editor which creates a new instance of GLCanvas, setOpaque(false) is called during the process of creating the GLCanvas and all of the GLCanvas are redrawn.
It seems that the NSWinow is at a level above all of the editors causing all of them to be affected. I realize the description is a bit convoluted. I'm not going into all of the detail of the class hierarchies. I'm just trying to fire enough information out there that it might ring a bell with someone who can give me a push in the right direction.
Powered by FUDForum
. Page generated in 0.01749 seconds