aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-11-26 18:15:59 +0100
committerSven Gothel <[email protected]>2012-11-26 18:15:59 +0100
commit8cf694c1424277e6358039a964ecd75c54cf9af9 (patch)
tree72c37d6e8efe5d64951fd5fb8ef258a679caa3ca /src/nativewindow/classes/javax
parent541bcc1eecc50656392e1fec1a27b08ab78eceff (diff)
SWTAccessor: OS_gtk_widget_unrealize optional (SWT 4.3) ; decorate PrivilegedAction for static initSingleton block (SWTAccessor, NewtFactory, NativeWindowFactory)
Diffstat (limited to 'src/nativewindow/classes/javax')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index 179610b25..d7f28a986 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -148,8 +148,18 @@ public abstract class NativeWindowFactory {
}
static {
- Platform.initSingleton();
- DEBUG = Debug.debug("NativeWindow");
+ final boolean[] _DEBUG = new boolean[] { false };
+ final String[] _tmp = new String[] { null };
+
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Platform.initSingleton(); // last resort ..
+ _DEBUG[0] = Debug.debug("NativeWindow");
+ _tmp[0] = Debug.getProperty("nativewindow.ws.name", true);
+ return null;
+ } } ) ;
+
+ DEBUG = _DEBUG[0];
if(DEBUG) {
System.err.println(Thread.currentThread().getName()+" - Info: NativeWindowFactory.<init>");
// Thread.dumpStack();
@@ -157,11 +167,10 @@ public abstract class NativeWindowFactory {
// Gather the windowing TK first
nativeWindowingTypePure = _getNativeWindowingType();
- final String tmp = Debug.getProperty("nativewindow.ws.name", true);
- if(null==tmp || tmp.length()==0) {
+ if(null==_tmp[0] || _tmp[0].length()==0) {
nativeWindowingTypeCustom = nativeWindowingTypePure;
} else {
- nativeWindowingTypeCustom = tmp.intern(); // canonical representation
+ nativeWindowingTypeCustom = _tmp[0].intern(); // canonical representation
}
}