|
From: <ka...@us...> - 2011-09-25 21:57:55
|
Revision: 3640
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3640&view=rev
Author: kappa1
Date: 2011-09-25 21:57:49 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
Fix issues with LWJGL Applets when dragging or switching browser tabs
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 2011-09-20 19:46:33 UTC (rev 3639)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-09-25 21:57:49 UTC (rev 3640)
@@ -142,7 +142,7 @@
private Canvas parent;
private long parent_window;
- private boolean xembedded;
+ private static boolean xembedded;
private long parent_proxy_focus_window;
private boolean parent_focused;
private long last_window_focus = 0;
@@ -299,6 +299,8 @@
private static native void synchronize(long display, boolean synchronize);
private static int globalErrorHandler(long display, long event_ptr, long error_display, long serial, long error_code, long request_code, long minor_code) throws LWJGLException {
+ if (xembedded) return 0; // ignore X errors in xembeded mode to fix browser issues like dragging or switching tabs
+
if (display == getDisplay()) {
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);
@@ -924,12 +926,6 @@
if (xembedded) {
long current_focus_window = 0;
- try {
- current_focus_window = nGetInputFocus(getDisplay());
- } catch (LWJGLException e) {
- return; // fail silently as it can fail whilst splitting browser tabs
- }
-
if (last_window_focus != current_focus_window || parent_focused != focused) {
if (isParentWindowActive(current_focus_window)) {
if (parent_focused) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|