NativeEventThread.cpp:

Install our own X error handler.  GDK's error handler
can exit in some cases, and this isn't the right behavior
for Java caused X errors.

WindowControlImpl.cpp:

Put in comments on how to debug on unix

runem.pl:

-classic doesn't work on Unix


git-svn-id: svn://10.0.0.236/branches/JAVADEV_RTM_20001102@87150 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2001-02-15 23:56:09 +00:00
parent 19af21ef93
commit fb87456485
3 changed files with 48 additions and 2 deletions

View File

@@ -71,6 +71,12 @@
#include <unistd.h>
#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);