Description: |
Changing the InterpRegistry atom on the root window is not allowed for untrusted clients. One way to work around this might be to install xlib error handler which ignores these errors. This fixes the problem for me.
In unix/tkUnixEvent.c
*----------------------------------------------------------------------
*
* XlibErrorHandler --
*
* This function is called for non-fatal X errors.
*
* Results:
* None.
*
* Side effects:
* Calls default error handler for most errors.
*
*----------------------------------------------------------------------
*/
static XErrorHandler OldXlibErrorHandler = NULL;
static int XlibErrorHandler(Display *d, XErrorEvent *e)
{
/* Don't fail for BadAccess errors caused by XChangeProperty.
* Changing the "InterpRegistry" atom on the root window fails
* for untrusted connections. */
// X_ChangePropery = 18
if ((BadAccess == e->error_code) && (18 == e->request_code))
return 0;
if (NULL != OldXlibErrorHandler)
OldXlibErrorHandler(d, e);
return 0;
}
And just install it before opening the display:
TkDisplay *
TkpOpenDisplay(
CONST char *displayNameStr)
{
TkDisplay *dispPtr;
OldXlibErrorHandler = XSetErrorHandler(XlibErrorHandler);
Display *display = XOpenDisplay(displayNameStr);
....
|