diff options
author | Sven Gothel <[email protected]> | 2019-11-22 17:20:00 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-11-22 17:20:00 +0100 |
commit | bb83bd2df5723ed145f59e9bd5d212de6c4daba8 (patch) | |
tree | 55526d2d0f52b7ac36408d312590e57cd2200d13 /src/newt/classes/jogamp | |
parent | 3dcfa24384078fca34ce3cc877649f7e2c2c084b (diff) |
Bug 1156: GBM: Fixing native GBM code, surviving initialization
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/egl/gbm/DisplayDriver.java | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/egl/gbm/WindowDriver.java | 20 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/egl/gbm/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/egl/gbm/DisplayDriver.java index e83e8e2a7..4d9835826 100644 --- a/src/newt/classes/jogamp/newt/driver/egl/gbm/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/egl/gbm/DisplayDriver.java @@ -29,7 +29,6 @@ package jogamp.newt.driver.egl.gbm; import com.jogamp.nativewindow.AbstractGraphicsDevice; import com.jogamp.nativewindow.NativeWindowException; -import com.jogamp.nativewindow.egl.EGLGraphicsDevice; import com.jogamp.opengl.GLProfile; import jogamp.newt.DisplayImpl; @@ -51,7 +50,7 @@ public class DisplayDriver extends DisplayImpl { if (!WindowDriver.initIDs()) { throw new NativeWindowException("Failed to initialize egl.gbm Window jmethodIDs"); } - drmHandle = initDrm(); + drmHandle = initDrm(DEBUG); } static void validateDrm() { @@ -62,7 +61,6 @@ public class DisplayDriver extends DisplayImpl { public static void initSingleton() { // just exist to ensure static init has been run - validateDrm(); } private static void shutdownHook() { @@ -100,7 +98,7 @@ public class DisplayDriver extends DisplayImpl { // Internals only // private static native boolean initIDs(); - private static native long initDrm(); + private static native long initDrm(boolean verbose); private static native void freeDrm(long drmHandle); private static native long OpenGBMDisplay0(long drmHandle); diff --git a/src/newt/classes/jogamp/newt/driver/egl/gbm/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/egl/gbm/WindowDriver.java index 41f1bc359..79c0b0dac 100644 --- a/src/newt/classes/jogamp/newt/driver/egl/gbm/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/egl/gbm/WindowDriver.java @@ -49,8 +49,8 @@ public class WindowDriver extends WindowImpl { } public WindowDriver() { - linuxMouseTracker = LinuxMouseTracker.getSingleton(); - linuxEventDeviceTracker = LinuxEventDeviceTracker.getSingleton(); + linuxMouseTracker = null; // LinuxMouseTracker.getSingleton(); + linuxEventDeviceTracker = null; // LinuxEventDeviceTracker.getSingleton(); windowHandleClose = 0; } @@ -162,8 +162,12 @@ public class WindowDriver extends WindowImpl { } windowHandleClose = nativeWindowHandle; - addWindowListener(linuxEventDeviceTracker); - addWindowListener(linuxMouseTracker); + if( null != linuxEventDeviceTracker ) { + addWindowListener(linuxEventDeviceTracker); + } + if( null != linuxMouseTracker ) { + addWindowListener(linuxMouseTracker); + } focusChanged(false, true); } @@ -172,8 +176,12 @@ public class WindowDriver extends WindowImpl { final DisplayDriver display = (DisplayDriver) getScreen().getDisplay(); final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice(); - removeWindowListener(linuxMouseTracker); - removeWindowListener(linuxEventDeviceTracker); + if( null != linuxMouseTracker ) { + removeWindowListener(linuxMouseTracker); + } + if( null != linuxEventDeviceTracker ) { + removeWindowListener(linuxEventDeviceTracker); + } if( 0 != windowHandleClose ) { CloseWindow0(display.getGBMHandle(), windowHandleClose); |