From: <eli...@us...> - 2006-10-23 14:05:47
|
Revision: 2592 http://svn.sourceforge.net/java-game-lib/?rev=2592&view=rev Author: elias_naur Date: 2006-10-23 07:05:40 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Linux: Added sanity check to LinuxDisplay.getDisplay() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 13:58:33 UTC (rev 2591) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-23 14:05:40 UTC (rev 2592) @@ -258,7 +258,7 @@ if (display_connection_usage_count < 0) throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count); if (display_connection_usage_count == 0) { - closeDisplay(getDisplay()); + closeDisplay(display); display = 0; GLContext.unloadOpenGLLibrary(); } @@ -281,6 +281,8 @@ } static long getDisplay() { + if (display_connection_usage_count <= 0) + throw new InternalError("display_connection_usage_count = " + display_connection_usage_count); return display; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2006-10-24 09:59:12
|
Revision: 2600 http://svn.sourceforge.net/java-game-lib/?rev=2600&view=rev Author: elias_naur Date: 2006-10-24 02:59:00 -0700 (Tue, 24 Oct 2006) Log Message: ----------- Linux: Removed redundant methods from LinuxDisplay.java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-24 09:52:12 UTC (rev 2599) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2006-10-24 09:59:00 UTC (rev 2600) @@ -645,29 +645,35 @@ switch (event_buffer.getType()) { case LinuxEvent.ClientMessage: if (event_buffer.getClientMessageType() == warp_atom) { - handleWarpEvent(event_buffer.getClientData(0), event_buffer.getClientData(1)); + if (mouse != null) + mouse.handleWarpEvent(event_buffer.getClientData(0), event_buffer.getClientData(1)); } else if ((event_buffer.getClientFormat() == 32) && (event_buffer.getClientData(0) == delete_atom)) - handleCloseEvent(); + close_requested = true; break; case LinuxEvent.MapNotify: - handleMapNotifyEvent(); + dirty = true; + minimized = false; break; case LinuxEvent.UnmapNotify: - handleUnmapNotifyEvent(); + dirty = true; + minimized = true; break; case LinuxEvent.Expose: - handleExposeEvent(); + dirty = true; break; case LinuxEvent.ButtonPress: /* Fall through */ case LinuxEvent.ButtonRelease: - handleButtonEvent(event_buffer.getButtonTime(), event_buffer.getButtonType(), event_buffer.getButtonButton(), event_buffer.getButtonState()); + if (mouse != null) + mouse.handleButtonEvent(grab, event_buffer.getButtonTime(), event_buffer.getButtonType(), (byte)event_buffer.getButtonButton()); break; case LinuxEvent.MotionNotify: - handlePointerMotionEvent(event_buffer.getButtonTime(), event_buffer.getButtonRoot(), event_buffer.getButtonXRoot(), event_buffer.getButtonYRoot(), event_buffer.getButtonX(), event_buffer.getButtonY(), event_buffer.getButtonState()); + if (mouse != null) + mouse.handlePointerMotion(grab, shouldWarpPointer(), event_buffer.getButtonTime(), event_buffer.getButtonRoot(), event_buffer.getButtonXRoot(), event_buffer.getButtonYRoot(), event_buffer.getButtonX(), event_buffer.getButtonY()); break; case LinuxEvent.KeyPress: /* Fall through */ case LinuxEvent.KeyRelease: - handleKeyEvent(event_buffer.getKeyAddress(), event_buffer.getKeyTime(), event_buffer.getKeyType(), event_buffer.getKeyKeyCode(), event_buffer.getKeyState()); + if (keyboard != null) + keyboard.handleKeyEvent(event_buffer.getKeyAddress(), event_buffer.getKeyTime(), event_buffer.getKeyType(), event_buffer.getKeyKeyCode(), event_buffer.getKeyState()); break; default: break; @@ -1065,42 +1071,4 @@ } private static native void nSetWindowIcon(long display, long window, ByteBuffer icon, int icons_size, int width, int height); - - private void handleButtonEvent(long millis, int type, int button, int state) { - if (mouse != null) - mouse.handleButtonEvent(grab, millis, type, (byte)button); - } - - private void handleKeyEvent(long event_ptr, long millis, int type, int keycode, int state) { - if (keyboard != null) - keyboard.handleKeyEvent(event_ptr, millis, type, keycode, state); - } - - private void handlePointerMotionEvent(long millis, long root_window, int x_root, int y_root, int x, int y, int state) { - if (mouse != null) - mouse.handlePointerMotion(grab, shouldWarpPointer(), millis, root_window, x_root, y_root, x, y); - } - - private void handleWarpEvent(int x, int y) { - if (mouse != null) - mouse.handleWarpEvent(x, y); - } - - private void handleExposeEvent() { - dirty = true; - } - - private void handleUnmapNotifyEvent() { - dirty = true; - minimized = true; - } - - private void handleMapNotifyEvent() { - dirty = true; - minimized = false; - } - - private void handleCloseEvent() { - close_requested = true; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-18 07:15:37
|
Revision: 2819 http://svn.sourceforge.net/java-game-lib/?rev=2819&view=rev Author: elias_naur Date: 2007-05-18 00:15:35 -0700 (Fri, 18 May 2007) Log Message: ----------- Linux: Removed GCJ workaround since current GCJ versions support re-entrant AWT locking Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-13 22:01:48 UTC (rev 2818) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-18 07:15:35 UTC (rev 2819) @@ -67,15 +67,6 @@ private static final int XRANDR = 10; private static final int XF86VIDMODE = 11; private static final int NONE = 12; - - /** Keep track on the current awt lock owner to avoid - * depending on JAWT locking to be re-entrant (This is a - * problem with GCJ). JAWT locking is not that well specified - * anyway so it is probably best to avoid assuming too much - * about it. - */ - private static Thread current_awt_lock_owner; - private static int awt_lock_count; /** Current X11 Display pointer */ private static long display; @@ -212,41 +203,20 @@ * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to * do just that. */ - static synchronized void lockAWT() { - Thread this_thread = Thread.currentThread(); - while (current_awt_lock_owner != null && current_awt_lock_owner != this_thread) { - try { - LinuxDisplay.class.wait(); - } catch (InterruptedException e) { - LWJGLUtil.log("Interrupted while waiting for awt lock: " + e); - } + static void lockAWT() { + try { + nLockAWT(); + } catch (LWJGLException e) { + LWJGLUtil.log("Caught exception while locking AWT: " + e); } - if (awt_lock_count == 0) { - current_awt_lock_owner = this_thread; - try { - nLockAWT(); - } catch (LWJGLException e) { - LWJGLUtil.log("Caught exception while locking AWT: " + e); - } - } - awt_lock_count++; } private static native void nLockAWT() throws LWJGLException; - static synchronized void unlockAWT() { - if (awt_lock_count <= 0) - throw new IllegalStateException("AWT not locked!"); - if (Thread.currentThread() != current_awt_lock_owner) - throw new IllegalStateException("AWT already locked by " + current_awt_lock_owner); - awt_lock_count--; - if (awt_lock_count == 0) { - try { - nUnlockAWT(); - } catch (LWJGLException e) { - LWJGLUtil.log("Caught exception while unlocking AWT: " + e); - } - current_awt_lock_owner = null; - LinuxDisplay.class.notify(); + static void unlockAWT() { + try { + nUnlockAWT(); + } catch (LWJGLException e) { + LWJGLUtil.log("Caught exception while unlocking AWT: " + e); } } private static native void nUnlockAWT() throws LWJGLException; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-27 13:17:37
|
Revision: 2831 http://svn.sourceforge.net/java-game-lib/?rev=2831&view=rev Author: elias_naur Date: 2007-05-27 06:17:35 -0700 (Sun, 27 May 2007) Log Message: ----------- Linux: Move input grab update from createWindow to when MapNotify is received. This avoid any input grabbing being ignored because the window is not yet mapped Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-27 13:09:48 UTC (rev 2830) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-27 13:17:35 UTC (rev 2831) @@ -373,7 +373,6 @@ grab = false; minimized = false; dirty = true; - updateInputGrab(); } finally { peer_info.unlock(); } @@ -615,6 +614,7 @@ case LinuxEvent.MapNotify: dirty = true; minimized = false; + updateInputGrab(); break; case LinuxEvent.UnmapNotify: dirty = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-15 06:58:40
|
Revision: 2853 http://svn.sourceforge.net/java-game-lib/?rev=2853&view=rev Author: elias_naur Date: 2007-06-14 23:58:38 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Linux: Don't use seperate Display connections to switch display modes Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-06-11 18:43:13 UTC (rev 2852) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-06-15 06:58:38 UTC (rev 2853) @@ -421,11 +421,11 @@ } private void switchDisplayModeOnTmpDisplay(DisplayMode mode) throws LWJGLException { - long tmp_display = openDisplay(); + incDisplay(); try { - nSwitchDisplayMode(tmp_display, nGetDefaultScreen(tmp_display), current_displaymode_extension, mode); + nSwitchDisplayMode(getDisplay(), getDefaultScreen(), current_displaymode_extension, mode); } finally { - closeDisplay(tmp_display); + decDisplay(); } } private static native void nSwitchDisplayMode(long display, int screen, int extension, DisplayMode mode) throws LWJGLException; @@ -495,11 +495,11 @@ } private void setGammaRampOnTmpDisplay(ByteBuffer native_gamma) throws LWJGLException { - long tmp_display = openDisplay(); + incDisplay(); try { - nSetGammaRamp(tmp_display, nGetDefaultScreen(tmp_display), native_gamma); + nSetGammaRamp(getDisplay(), getDefaultScreen(), native_gamma); } finally { - closeDisplay(tmp_display); + decDisplay(); } } private static native void nSetGammaRamp(long display, int screen, ByteBuffer gammaRamp) throws LWJGLException; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-08-27 15:51:36
|
Revision: 2888 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2888&view=rev Author: elias_naur Date: 2007-08-26 15:07:24 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Linux: Don't close the static Display connection, to avoid crashes with some dri drivers Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-08-26 20:47:29 UTC (rev 2887) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-08-26 22:07:24 UTC (rev 2888) @@ -233,14 +233,19 @@ } static void decDisplay() { - display_connection_usage_count--; + /* + * Some drivers (at least some versions of the radeon dri driver) + * don't like it when the display is closed and later re-opened, + * so we'll just let the singleton display connection leak. + */ +/* display_connection_usage_count--; if (display_connection_usage_count < 0) throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count); if (display_connection_usage_count == 0) { closeDisplay(display); display = 0; GLContext.unloadOpenGLLibrary(); - } + }*/ } static native long openDisplay() throws LWJGLException; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-12 21:45:11
|
Revision: 3010 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3010&view=rev Author: elias_naur Date: 2008-04-12 14:45:04 -0700 (Sat, 12 Apr 2008) Log Message: ----------- Linux: More focus fixes for the applet (XEmbed) case Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-12 20:45:43 UTC (rev 3009) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-12 21:45:04 UTC (rev 3010) @@ -43,6 +43,8 @@ import java.nio.IntBuffer; import java.awt.Canvas; +import java.awt.event.FocusListener; +import java.awt.event.FocusEvent; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; @@ -126,10 +128,27 @@ private boolean parent_focus_window_valid; private long parent_window; private boolean xembedded; + private boolean parent_focused; + private boolean parent_focus_changed; private LinuxKeyboard keyboard; private LinuxMouse mouse; + private final FocusListener focus_listener = new FocusListener() { + public final void focusGained(FocusEvent e) { + synchronized (GlobalLock.lock) { + parent_focused = true; + parent_focus_changed = true; + } + } + public final void focusLost(FocusEvent e) { + synchronized (GlobalLock.lock) { + parent_focused = false; + parent_focus_changed = true; + } + } + }; + private static ByteBuffer getCurrentGammaRamp() throws LWJGLException { lockAWT(); try { @@ -395,6 +414,9 @@ long root_window = getRootWindow(getDisplay(), getDefaultScreen()); current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, root_window); if (parent != null) { + parent.addFocusListener(focus_listener); + parent_focused = parent.isFocusOwner(); + parent_focus_changed = true; parent_window = getHandle(parent); changeSaveSet(getDisplay(), current_window, SetModeInsert, SaveSetRoot, SaveSetUnmap); reparentWindow(getDisplay(), current_window, parent_window, x, y); @@ -464,6 +486,8 @@ public void destroyWindow() { lockAWT(); try { + if (parent != null) + parent.removeFocusListener(focus_listener); try { setNativeCursor(null); } catch (LWJGLException e) { @@ -819,21 +843,23 @@ unlockAWT(); } } - + private void checkInput() { - if (parent == null) + if (parent == null || !parent_focus_changed) return; if (focused) { - if (xembedded && !parent.isFocusOwner() && parent_focus_window_valid) { + if (xembedded && !parent_focused && parent_focus_window_valid) { setInputFocusUnsafe(parent_focus_window); + parent_focus_changed = false; } } else { - if (parent.isFocusOwner()) { + if (parent_focused) { if (xembedded) { parent_focus_window = nGetInputFocus(getDisplay()); parent_focus_window_valid = true; } setInputFocusUnsafe(getWindow()); + parent_focus_changed = false; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-13 11:28:44
|
Revision: 3014 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3014&view=rev Author: elias_naur Date: 2008-04-13 04:28:41 -0700 (Sun, 13 Apr 2008) Log Message: ----------- Linux: Don't let display usage count reach 0 Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 08:34:39 UTC (rev 3013) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 11:28:41 UTC (rev 3014) @@ -291,15 +291,15 @@ private static native String getErrorText(long display, long error_code); static void decDisplay() { - display_connection_usage_count--; - if (display_connection_usage_count < 0) - throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count); /* * Some drivers (at least some versions of the radeon dri driver) * don't like it when the display is closed and later re-opened, * so we'll just let the singleton display connection leak. */ -/* if (display_connection_usage_count == 0) { +/* display_connection_usage_count--; + if (display_connection_usage_count < 0) + throw new InternalError("display_connection_usage_count < 0: " + display_connection_usage_count); + if (display_connection_usage_count == 0) { closeDisplay(display); resetErrorHandler(saved_error_handler); display = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-13 18:13:31
|
Revision: 3018 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3018&view=rev Author: elias_naur Date: 2008-04-13 11:13:26 -0700 (Sun, 13 Apr 2008) Log Message: ----------- LinuxDisplay.java: Fixed missing return Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 18:11:38 UTC (rev 3017) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 18:13:26 UTC (rev 3018) @@ -285,7 +285,7 @@ String error_msg = getErrorText(display, error_code); throw new LWJGLException("X Error - disp: 0x" + Long.toHexString(error_display) + " serial: " + serial + " error: " + error_msg + " request_code: " + request_code + " minor_code: " + minor_code); } else if (saved_error_handler != 0) - callErrorHandler(saved_error_handler, display, event_ptr); + return callErrorHandler(saved_error_handler, display, event_ptr); return 0; } private static native String getErrorText(long display, long error_code); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-13 18:46:29
|
Revision: 3021 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3021&view=rev Author: elias_naur Date: 2008-04-13 11:46:25 -0700 (Sun, 13 Apr 2008) Log Message: ----------- Linux: Another focus fix Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 18:43:27 UTC (rev 3020) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 18:46:25 UTC (rev 3021) @@ -427,7 +427,7 @@ current_window_mode = getWindowMode(fullscreen); boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || current_window_mode != WINDOWED; this.parent = parent; - long parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen()); + parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen()); current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window); mapRaised(getDisplay(), current_window); xembedded = parent != null && isAncestorXEmbedded(parent_window); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-13 19:12:53
|
Revision: 3022 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3022&view=rev Author: elias_naur Date: 2008-04-13 12:12:51 -0700 (Sun, 13 Apr 2008) Log Message: ----------- Linux: Another applet focus tweak Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 18:46:25 UTC (rev 3021) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-04-13 19:12:51 UTC (rev 3022) @@ -860,8 +860,10 @@ return; if (focused) { if (xembedded && !parent_focused && parent_focus_window_valid) { - setInputFocusUnsafe(parent_focus_window); - parent_focus_changed = false; + if (nGetInputFocus(getDisplay()) == current_window) { + setInputFocusUnsafe(parent_focus_window); + parent_focus_changed = false; + } } } else { if (parent_focused) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-06-16 18:31:53
|
Revision: 3104 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3104&view=rev Author: elias_naur Date: 2008-06-16 11:31:43 -0700 (Mon, 16 Jun 2008) Log Message: ----------- Linux: Added sanity checking to LinuxDisplay.setIcon Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-06-16 18:29:18 UTC (rev 3103) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-06-16 18:31:43 UTC (rev 3104) @@ -1193,10 +1193,12 @@ for (int i=0;i<icons.length;i++) { int size = icons[i].limit() / 4; int dimension = (int)Math.sqrt(size); - ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension); - ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension); - nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension); - return 1; + if (dimension > 0) { + ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension); + ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension); + nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension); + return 1; + } } return 0; } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |