David Firth
2006-Jul-11 22:03 UTC
[Rd] Linux/MacOSX and "X11 protocol error: BadWindow..." warnings
This concerns behaviour which has been noted previously, for example see http://tolstoy.newcastle.edu.au/R/help/05/03/0844.html http://tolstoy.newcastle.edu.au/R/help/03b/6873.html and especially the thread http://tolstoy.newcastle.edu.au/R/help/04/08/3025.html I find that it affects both my Linux and Mac OS X setups. It is a feature which has caused some (at least John Fox in the Rcmdr package) to make special moves to catch the warnings and hide them from users. 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). best wishes, David -- Professor David Firth http://www.warwick.ac.uk/go/dfirth ********* On Linux (SUSE 10.0) with R 2.3.1 ******** ********* and xorg-x11 version 6.8.2-100 ******** david at blackbox2:~> R --vanilla R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.> options(warn = 1) > library(tcltk)Loading Tcl/Tk interface ... done> tktoplevel()$ID [1] ".1" $env <environment: 0x899ba30> attr(,"class") [1] "tkwin" ## Now close the Tk window using window controls> X11() > tktoplevel()$ID [1] ".2" $env <environment: 0x86f8ff4> attr(,"class") [1] "tkwin" ## Now close the Tk window using window controls> Warning: X11 protocol error: BadWindow (invalid Windowparameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter)> version_ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 3.1 year 2006 month 06 day 01 svn rev 38247 language R version.string Version 2.3.1 (2006-06-01) ********* On Mac OS 10.4, using R 2.2.0 ******** david% R --vanilla R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.0 (2005-10-06 r35749) ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R.> options(warn=1) > library(tcltk)Loading Tcl/Tk interface ... done> tktoplevel()$ID [1] ".1" $env <environment: 0x28d2578> attr(,"class") [1] "tkwin" ## Now close the Tk window using window controls> X11() > tktoplevel()$ID [1] ".2" $env <environment: 0x28f2a78> attr(,"class") [1] "tkwin" ## Now close the Tk window using window controls> Warning: X11 protocol error: BadWindow (invalid Windowparameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter) Warning: X11 protocol error: BadWindow (invalid Window parameter)> version_ platform powerpc-apple-darwin8.2.0 arch powerpc os darwin8.2.0 system powerpc, darwin8.2.0 status major 2 minor 2.0 year 2005 month 10 day 06 svn rev 35749 language R
Peter Dalgaard
2006-Jul-11 22:57 UTC
[Rd] Linux/MacOSX and "X11 protocol error: BadWindow..." warnings
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