Login  Register

NativeWindowException: Unable to lock surface

Posted by sranger on May 21, 2013; 3:00pm
URL: https://forum.jogamp.org/NativeWindowException-Unable-to-lock-surface-tp4029205.html

I'm getting some odd behavior after updating java to 1.7. Any JOGL apps inside my OSGi (SWT using the AWT_SWT bridge with the AWT GLCanvas) application will only work correctly on my primary display. If I move them to my secondary display they tear off a window titled "JavaEmbeddedFrame" which stays on the main display. If I attempt to move that window to the secondary display it eventually throws a NativeWindowException. Also, it will sometimes stop displaying my 3D scene correctly by only displaying content during animation and just the component's background color when not animating.

I have an AMD Radeon 7950 running Ubuntu 13.04. My co-worker that uses Ubuntu 12.04 with an nVidia card with the same issues but another co-worker with debian and an nVidia card has no issues. No issues on our Windows machines, either. No issues under Java 1.6.

Anyone have any ideas why I'm getting these issues? Could it just be a configuration issue? I tried the newest version of JOGL (lots of API changes, yay!) but still the same issues. Our JOGL applications not using the AWT_SWT bridge don't have issues.

Get this output when application starts
libEGL warning: DRI2: failed to authenticate

and stops
X11Util.Display: Shutdown (close open / pending Displays: false, open (no close attempt): 1/1, pending (not closed, marked uncloseable): 2)
X11Util: Open X11 Display Connections: 1
X11Util: Open[0]: NamedX11Display[:0, 0x7fd9c43200c0, refCount 1, unCloseable true]
X11Util: Pending X11 Display Connections: 2
X11Util: Pending[0]: NamedX11Display[:0, 0x7fd9cc196bb0, refCount 0, unCloseable true]
X11Util: Pending[1]: NamedX11Display[:0, 0x7fd998000e10, refCount 0, unCloseable true]

Getting the following exception when trying to maximize the screen.
Caused by: javax.media.nativewindow.NativeWindowException: Unable to lock surface
	at jogamp.nativewindow.jawt.x11.X11JAWTWindow.lockSurfaceImpl(X11JAWTWindow.java:85)
	at com.jogamp.nativewindow.awt.JAWTWindow.lockSurface(JAWTWindow.java:314)
	at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:236)
	at jogamp.opengl.GLDrawableImpl.setRealized(GLDrawableImpl.java:156)
	at javax.media.opengl.awt.GLCanvas$2.run(GLCanvas.java:577)
	at jogamp.common.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:49)
	at javax.media.opengl.awt.GLCanvas.validateGLDrawable(GLCanvas.java:563)
	at javax.media.opengl.awt.GLCanvas.access$500(GLCanvas.java:141)
	at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:963)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


 - Stephen