diff -r 21f7b7b19199 glass/glass-mat-lib-gtk/src/com/sun/glass/ui/GlassApplication.cpp --- a/glass/glass-mat-lib-gtk/src/com/sun/glass/ui/GlassApplication.cpp Thu Sep 13 10:39:35 2012 +0200 +++ b/glass/glass-mat-lib-gtk/src/com/sun/glass/ui/GlassApplication.cpp Thu Sep 13 14:04:30 2012 +0400 @@ -22,6 +22,7 @@ #include "glass_dnd.hpp" #include "glass_window.hpp" +GdkEventFunc process_events_prev; static void process_events(GdkEvent*, gpointer); JNIEnv* mainEnv; // Use only with main loop thread!!! @@ -180,10 +181,10 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_com_sun_glass_ui_gtk_GtkApplication__1init - (JNIEnv * env, jobject obj) + (JNIEnv * env, jobject obj, jlong handler) { mainEnv = env; - + process_events_prev = (GdkEventFunc) handler; gdk_event_handler_set(process_events, NULL, NULL); GdkScreen *default_gdk_screen = gdk_screen_get_default(); @@ -537,7 +538,12 @@ } } } - - gtk_main_do_event(event); //process only for non-FX windows + + //process only for non-FX windows + if (process_events_prev != NULL) { + (*process_events_prev)(event, data); + } else { + gtk_main_do_event(event); + } } } diff -r 21f7b7b19199 glass/glass-mat/src/com/sun/glass/ui/Application.java --- a/glass/glass-mat/src/com/sun/glass/ui/Application.java Thu Sep 13 10:39:35 2012 +0200 +++ b/glass/glass-mat/src/com/sun/glass/ui/Application.java Thu Sep 13 14:04:30 2012 +0400 @@ -96,7 +96,7 @@ deviceDetails = details; } - protected static Map getDeviceDetails() { + public static Map getDeviceDetails() { return deviceDetails; } diff -r 21f7b7b19199 glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java --- a/glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java Thu Sep 13 10:39:35 2012 +0200 +++ b/glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java Thu Sep 13 14:04:30 2012 +0400 @@ -56,7 +56,13 @@ private void init() { initDisplay(); - _init(); + long eventProc = 0; + Map map = getDeviceDetails(); + if (map != null) { + Long result = (Long) map.get("javafx.embed.eventProc"); + eventProc = result == null ? 0 : result.longValue(); + } + _init(eventProc); } @Override @@ -118,7 +124,7 @@ private native void _terminateLoop(); - private native void _init(); + private native void _init(long eventProc); protected native void _runLoop(Runnable launchable, boolean embedded); diff -r 21f7b7b19199 javafx-embed-swt/project.properties --- a/javafx-embed-swt/project.properties Thu Sep 13 10:39:35 2012 +0200 +++ b/javafx-embed-swt/project.properties Thu Sep 13 14:04:30 2012 +0400 @@ -1,6 +1,7 @@ javac.classpath=\ ${runtime.dist.root.dir}/javafx-common/dist/javafx-common.jar:\ ${rt.dist.root.dir}/javafx-ui-common/dist/javafx-ui-common.jar:\ + ${runtime.dist.root.dir}/glass/glass-mat/dist/glass.jar:\ ${import.swt.jar} javac.test.classpath=\ ${javac.classpath}:\ diff -r 21f7b7b19199 javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java --- a/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java Thu Sep 13 10:39:35 2012 +0200 +++ b/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java Thu Sep 13 14:04:30 2012 +0400 @@ -24,13 +24,17 @@ */ package javafx.embed.swt; +import java.lang.reflect.Field; import java.nio.IntBuffer; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import com.sun.glass.ui.Application; import com.sun.javafx.cursor.CursorFrame; import com.sun.javafx.cursor.CursorType; @@ -193,6 +197,27 @@ return null; } }); + Map map = Application.getDeviceDetails(); + if (map == null) { + Application.setDeviceDetails(map = new HashMap()); + } + if (map.get("javafx.embed.eventProc") == null) { + long eventProc = 0; + try { + Field field = Display.class.getDeclaredField("eventProc"); + field.setAccessible(true); + if (field.getType() == int.class) { + eventProc = field.getLong(Display.getDefault()); + } else { + if (field.getType() == long.class) { + eventProc = field.getLong(Display.getDefault()); + } + } + } catch (Throwable th) { + //Fail silently + } + map.put("javafx.embed.eventProc", eventProc); + } // Note that calling PlatformImpl.startup more than once is OK PlatformImpl.startup(new Runnable() { @Override diff -r 21f7b7b19199 javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java --- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java Thu Sep 13 10:39:35 2012 +0200 +++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java Thu Sep 13 14:04:30 2012 +0400 @@ -76,7 +76,15 @@ throw new RuntimeException(MSG); } else { Map device = GraphicsPipeline.getPipeline().getDeviceDetails(); - Application.setDeviceDetails(device); + if (device != null) { + Map map = Application.getDeviceDetails(); + if (map != null) { + map.putAll(device); + Application.setDeviceDetails(map); + } else { + Application.setDeviceDetails(device); + } + } } } catch (Throwable th) { QuantumRenderer.this.setInitThrowable(th);