From a1e593cee084a2ab0dee5e6b9ec385c4013ea4d1 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 25 Apr 2005 07:26:07 +0000 Subject: [PATCH] Linux: Fixed crash --- src/java/org/lwjgl/opengl/LinuxDisplay.java | 28 ++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index c21cf497..3f7830f5 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -306,17 +306,33 @@ final class LinuxDisplay implements DisplayImplementation { public int getMinCursorSize() { lockAWT(); - int min_size = nGetMinCursorSize(); - unlockAWT(); - return min_size; + try { + incDisplay(); + int min_size = nGetMinCursorSize(); + decDisplay(); + return min_size; + } catch (LWJGLException e) { + LWJGLUtil.log("Exception occurred in getMinCursorSize: " + e); + return 0; + } finally { + unlockAWT(); + } } private static native int nGetMinCursorSize(); public int getMaxCursorSize() { lockAWT(); - int max_size = nGetMaxCursorSize(); - unlockAWT(); - return max_size; + try { + incDisplay(); + int max_size = nGetMaxCursorSize(); + decDisplay(); + return max_size; + } catch (LWJGLException e) { + LWJGLUtil.log("Exception occurred in getMaxCursorSize: " + e); + return 0; + } finally { + unlockAWT(); + } } private static native int nGetMaxCursorSize();