From be0fbdf13b0f904cb6f83406a48c42182f1f12cf Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 13 Apr 2008 18:43:27 +0000 Subject: [PATCH] Applet focus fixes --- src/java/org/lwjgl/opengl/LinuxDisplay.java | 2 +- src/native/linux/org_lwjgl_opengl_Display.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 50b31ed8..f9f8cdba 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -468,7 +468,7 @@ final class LinuxDisplay implements DisplayImplementation { private boolean isAncestorXEmbedded(long window) throws LWJGLException { long xembed_atom = internAtom("_XEMBED_INFO", true); if (xembed_atom != None) { - long w = parent_window; + long w = window; while (w != None) { if (hasProperty(getDisplay(), w, xembed_atom)) return true; diff --git a/src/native/linux/org_lwjgl_opengl_Display.c b/src/native/linux/org_lwjgl_opengl_Display.c index aae01bc5..cb0838c9 100644 --- a/src/native/linux/org_lwjgl_opengl_Display.c +++ b/src/native/linux/org_lwjgl_opengl_Display.c @@ -85,8 +85,11 @@ static int global_error_handler(Display *disp, XErrorEvent *error) { JNIEnv *env = getThreadEnv(); if (env != NULL) { jclass org_lwjgl_LinuxDisplay_class = (*env)->FindClass(env, "org/lwjgl/opengl/LinuxDisplay"); - if (org_lwjgl_LinuxDisplay_class == NULL) + if (org_lwjgl_LinuxDisplay_class == NULL) { + // Don't propagate error + (*env)->ExceptionClear(env); return 0; + } jmethodID handler_method = (*env)->GetStaticMethodID(env, org_lwjgl_LinuxDisplay_class, "globalErrorHandler", "(JJJJJJJ)I"); if (handler_method == NULL) return 0;