Hi Dave, >> Hi dave, >> >> I found a bug this week end when I try to use bang. Actually it makes >> e crashing when the composite extension is not enabled. The error >> comes from the errorhandler section in the debugging part at the >> line >> o = e->error_code - compDisplays->damageError which should be >> replaced by this >> >> o = e->error_code; >> if(compDisplays) >> o-= compDisplays->damageError; > Thanks, fixed... > but the real problem is that bang attach the x error handler with: > XSetErrorHandler (errorHandler); > and never release it (so the function is called also when bang didn't > exist anymore)... > some know the X function to remove the handler? I didn't found it :( > Searching on google gave me one hack to reverse back to the old configuration. Actually it seems that there is no functions reversing back to the old configuration in Xlib so we have to do it ourself. After searching I found this way
static XErrorHandler old_handler = (XErrorHandler) 0 ; /* this variable is needed to obtain the address of the actual ErrorHandler function (for instance the one defined in the toolkit) in the function that call XsetErrorHandler put this /* Install our error handler to override Xlib's termination behavior */ old_handler = XSetErrorHandler(ApplicationErrorHandler) ; and put this line before finishing the application /* Restore original X handler */ /* Assumption: the X queue has been temporarily flushed/synchronized */ /* at the end of the application-critical code, otherwise a possible */ /* asynchronously arriving error might arrive further down the stream */ /* after the original handlers are restored. */ /* XFlush(display) */ /* XSync(display, False) ; */ XSetErrorHandler(old_handler); return whatever you want. It seems that it is the only way to restore the initial ErrorHandler function, but confirmation or suggestion from people familiar with xlib are welcome of course :-) ciao Mathieu ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel