[Rd] Linux/MacOSX and "X11 protocol error: BadWindow..." warnings

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Jul 12 00:57:02 CEST 2006

David Firth <d.firth at warwick.ac.uk> writes:

> In an effort to pin it down, outside of Rcmdr or any 
> packages other than tcltk itself, I came up with a simple 
> reproducible example.  Essentially, the sequence that gives 
> the warnings is
>   tktoplevel()
> [then close the Tk window using the window controls]
>   X11()
>   tktoplevel()
> [then close the Tk window using the wondow controls]
> Closing the second Tk window is the act that seems to 
> provoke the warnings (see the two session transcripts 
> below).  The number of warnings is different on my two 
> systems, but I don't know whather that's to do with OS, or 
> X11, or the two different versions of R, or what.
> Without the call to X11(), I do not get the warnings.  And 
> the call to X11() seemingly needs to come *after* the first 
> tktoplevel() call in order for the warnings to be 
> generated.
> Unfortunately I do not have access to other systems on which 
> to test this, or the necessary knowledge of X11, Tk etc to 
> be able to debug it.  I am noting it here only in the hope 
> that it might be useful to someone else on R-devel who is 
> better placed to identify the likely cause(s).

I can reproduce this with on Fedora Core 5.

One might guess is that this has to do with the intertwining of the
two event loops. Not unlikely, the X11 event handler is discarding
some events that the Tcl/Tk event handler should have known about.
I've meddled with both, but it was many moons ago...

   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907

More information about the R-devel mailing list