WARNING: KDE detected X Error

Andy Brice andyb1 at btclick.com
Tue Jan 13 15:51:08 GMT 2004


I have finally managed to replicate it reliably.  It comes up whenever the
KHtmlPart 'Server authentication' window appears. But it doesn't get trapped
by my_x_errhandler().

Would my_x_errhandler() pick up any X error created by KHtmlPart in a
separate thread?

The source for my main looks something like this:

#include <X11/Xlib.h>
#include <kdebug.h>
static int
my_x_errhandler( Display *dpy, XErrorEvent *err )
{
    char errstr[256];
    XGetErrorText( dpy, err->error_code, errstr, 256 );
    //if ( err->error_code != BadWindow )
        kdWarning() << "Detected X Error: " << errstr << " " <<
err->error_code
                << "\n  Major opcode:  " << err->request_code <<
kdBacktrace() << endl;
    return 0;
}

int
main( int argc, char** argv )
{
    KApplication app( argc, argv );

    XSetErrorHandler( my_x_errhandler );

    // create main window
    OFExpMainWindow* mainWin = new OFExpMainWindow;

    // initialise and show main window
    mainWin->ini();

    app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );

    return app.exec();
}

regards

Andy Brice






More information about the kfm-devel mailing list