diff --git a/mozilla/java/webclient/src_moz/NativeEventThread.cpp b/mozilla/java/webclient/src_moz/NativeEventThread.cpp index 7fbb0faece2..5c9992a6b12 100644 --- a/mozilla/java/webclient/src_moz/NativeEventThread.cpp +++ b/mozilla/java/webclient/src_moz/NativeEventThread.cpp @@ -71,6 +71,12 @@ #include #include "gdksuperwin.h" #include "gtkmozarea.h" + +extern "C" { + static int wc_x_error (Display *display, + XErrorEvent *error); +} + #endif static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID); @@ -118,6 +124,29 @@ extern const char * gBinDir; // defined in WrapperFactoryImpl.cpp // Local functions // +#ifdef XP_UNIX +static int +wc_x_error (Display *display, + XErrorEvent *error) +{ + if (error->error_code) + { + char buf[64]; + + XGetErrorText (display, error->error_code, buf, 63); + + fprintf (stderr, "Webclient-Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n", + buf, + error->serial, + error->error_code, + error->request_code, + error->minor_code); + } + + return 0; +} +#endif + /** * Called from InitMozillaStuff(). @@ -200,6 +229,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NativeEventThr "NULL webShellPtr passed to nativeProcessEvents."); return; } + void* threadId = PR_GetCurrentThread(); if (threadId == (void *) gEmbeddedThread) { // printf("--------- Thread ID ---- %p\n",gEmbeddedThread); @@ -677,6 +707,14 @@ nsresult InitMozillaStuff (WebShellInitContext * initContext) ("InitMozillaStuff(%lx): enter event loop\n", initContext)); } #endif + +#ifdef XP_UNIX + + // The gdk_x_error function exits in some cases, we don't + // want that. + XSetErrorHandler(wc_x_error); +#endif + // Just need to loop once to clear out events before returning processEventLoop(initContext); diff --git a/mozilla/java/webclient/src_moz/WindowControlImpl.cpp b/mozilla/java/webclient/src_moz/WindowControlImpl.cpp index 6e2216c5159..f3c70d0e756 100644 --- a/mozilla/java/webclient/src_moz/WindowControlImpl.cpp +++ b/mozilla/java/webclient/src_moz/WindowControlImpl.cpp @@ -104,6 +104,12 @@ JNIEXPORT jint JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI util_InitializeShareInitContext(&(initContext->shareContext)); #ifdef XP_UNIX + /***** Uncomment this to debug on unix + pid_t pid = getpid(); + printf("++++++++++++++++debug: edburns: pid is: %d\n", pid); + sleep(7); + **************/ + initContext->gtkWinPtr = (int)::util_GetGTKWinPtrFromCanvas(env, aBrowserControlImpl); #else diff --git a/mozilla/java/webclient/src_share/runem.pl b/mozilla/java/webclient/src_share/runem.pl index 5e76691ab49..74d8f0fb9ce 100644 --- a/mozilla/java/webclient/src_share/runem.pl +++ b/mozilla/java/webclient/src_share/runem.pl @@ -115,8 +115,10 @@ $cmd = $JAVA_CMD; if ($SEP eq "/") { $cmd = $cmd . " -native"; } -# workaround bug 64332, turn off hotspot and JIT -$cmd = $cmd . " -classic -Djava.compiler=NONE"; +else { + # workaround bug 64332 on Win32, turn off hotspot and JIT + $cmd = $cmd . " -classic -Djava.compiler=NONE"; +} #tack on the java library path $cmd = $cmd . " -Djava.library.path=" . $BINDIR;