diff -r d9d0425c829b 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 Tue Aug 07 13:03:45 2012 -0700 +++ b/glass/glass-mat-lib-gtk/src/com/sun/glass/ui/GlassApplication.cpp Wed Sep 12 16:43:46 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,11 @@ * 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(); @@ -538,7 +540,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 d9d0425c829b glass/glass-mat/src/com/sun/glass/ui/Application.java --- a/glass/glass-mat/src/com/sun/glass/ui/Application.java Tue Aug 07 13:03:45 2012 -0700 +++ b/glass/glass-mat/src/com/sun/glass/ui/Application.java Wed Sep 12 16:43:46 2012 -0400 @@ -94,7 +94,7 @@ deviceDetails = details; } - protected static Map getDeviceDetails() { + public static Map getDeviceDetails() { return deviceDetails; } diff -r d9d0425c829b glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java --- a/glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java Tue Aug 07 13:03:45 2012 -0700 +++ b/glass/glass-mat/src/com/sun/glass/ui/gtk/GtkApplication.java Wed Sep 12 16:43:46 2012 -0400 @@ -45,7 +45,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); } protected void runLoop(final String args[], final Launchable launchable) { @@ -106,7 +112,7 @@ private native void _terminateLoop(); - private native void _init(); + private native void _init(long eventProc); protected native void _runLoop(String[] args, Launchable launchable, boolean embedded); diff -r d9d0425c829b javafx-embed-swt/project.properties --- a/javafx-embed-swt/project.properties Tue Aug 07 13:03:45 2012 -0700 +++ b/javafx-embed-swt/project.properties Wed Sep 12 16:43:46 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 d9d0425c829b javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java --- a/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java Tue Aug 07 13:03:45 2012 -0700 +++ b/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java Wed Sep 12 16:43:46 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 d9d0425c829b javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java --- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java Tue Aug 07 13:03:45 2012 -0700 +++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumRenderer.java Wed Sep 12 16:43:46 2012 -0400 @@ -76,7 +76,13 @@ 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); + } } } catch (Throwable th) { QuantumRenderer.this.setInitThrowable(th);