summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2005-05-04 19:56:38 +0000
committerSilenio Quarti <silenio>2005-05-04 19:56:38 +0000
commit087f693c2613e1e2b7b9c98a18997f9c65fe98cc (patch)
treed3047edd390923bbeff2c35c43f955314bd345a3
parentaad6c6efc6826601d4f463a75c76cfcb4844b4e9 (diff)
downloadeclipse.platform.swt-087f693c2613e1e2b7b9c98a18997f9c65fe98cc.tar.gz
eclipse.platform.swt-087f693c2613e1e2b7b9c98a18997f9c65fe98cc.tar.xz
eclipse.platform.swt-087f693c2613e1e2b7b9c98a18997f9c65fe98cc.zip
74095
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library/swt_awt.c28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java6
2 files changed, 34 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library/swt_awt.c b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library/swt_awt.c
index b6c6db3f87..ff5c83e9a4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library/swt_awt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library/swt_awt.c
@@ -42,3 +42,31 @@ JNIEXPORT jint JNICALL SWT_AWT_NATIVE(getAWTHandle)
return result;
}
#endif
+
+#ifndef NO_setDebug
+JNIEXPORT void JNICALL SWT_AWT_NATIVE(setDebug)
+ (JNIEnv *env, jclass that, jobject frame, jboolean debug)
+{
+ JAWT awt;
+ JAWT_DrawingSurface* ds;
+ JAWT_DrawingSurfaceInfo* dsi;
+ JAWT_X11DrawingSurfaceInfo* dsi_x11;
+ jint lock;
+
+ awt.version = JAWT_VERSION_1_3;
+ if (JAWT_GetAWT(env, &awt) != 0) {
+ ds = awt.GetDrawingSurface(env, frame);
+ if (ds != NULL) {
+ lock = ds->Lock(ds);
+ if ((lock & JAWT_LOCK_ERROR) == 0) {
+ dsi = ds->GetDrawingSurfaceInfo(ds);
+ dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
+ XSynchronize(dsi_x11->display, debug);
+ ds->FreeDrawingSurfaceInfo(dsi);
+ ds->Unlock(ds);
+ }
+ }
+ awt.FreeDrawingSurface(ds);
+ }
+}
+#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
index 351929294d..93b582b5c1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java
@@ -16,6 +16,7 @@ import java.lang.reflect.Method;
/* SWT Imports */
import org.eclipse.swt.*;
import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Composite;
@@ -49,6 +50,7 @@ public class SWT_AWT {
static boolean loaded, swingInitialized;
static native final int /*long*/ getAWTHandle (Canvas canvas);
+static native final void setDebug (Frame canvas, boolean debug);
static synchronized void loadLibrary () {
if (loaded) return;
@@ -134,6 +136,10 @@ public static Frame new_Frame (final Composite parent) {
}
}
final Frame frame = (Frame) value;
+ if (Device.DEBUG) {
+ loadLibrary();
+ setDebug(frame, true);
+ }
try {
/* Call registerListeners() to make XEmbed focus traversal work */
Method method = clazz.getMethod("registerListeners", null);