Login  Register

JOGL2 conflicting with GTK?

Posted by Cyrille on Aug 01, 2010; 8:41pm
URL: https://forum.jogamp.org/JOGL2-conflicting-with-GTK-tp1013991.html

Hello everyone,

I managed to reproduce a very strange bug with JOGL2 on my debian box with Gnome: when I attempt to display a JFrame containing a JSplitpane with a JTree and a GLCanvas as children, the application happens to behave randomly in one of the two ways described below:
- a seg fault occurs in pthread_mutex_lock (libpthread.so) before the JFrame is visible on screen. Here is the error report hs_err_pid9548.log 
- the event dispatching thread locks in some methods of GTKNativeEngine. Depending on the machine, it hangs either in GTKNativeEngine.native_paint_flat_box or in GTKNativeEngine.native_paint_expander. As far as I know, the latter is the method in charge of drawing a little triangle on the left of a node in the JTree in order to expand or collapse it. The bug disappears if the TreeUI is not SynthTreeUI (the default), certainly because other tree UIs do not seem to draw any widget as tree node expander and therefore do not call native_paint_expander.

Of course, if I remove the GLCanvas or the JTree from my app, everything works fine. I tried to replace the GLCanvas by a simple Canvas or by a JPanel and I could not reproduce the bug.

It looks like the bug is not reproducible if the window manager is Compiz. I reproduced it with metacity.

I really cannot figure out the link between GTK and JOGL2. Does anybody have an idea?

To reproduce it on linux, you can run this very simple application.

Many thanks to anybody that is willing to help me!
Cyrille