Fortunately, jcristau gave a response on the upstream bug. He indicates that BadWindow is indeed an appropriate response from the xserver in this case, and is returned when the Window parameter passed to XQueryTree is invalid. I've requested that the XQueryTree man page be updated with this info, and we can consider the libx11 task resolved once that is completed.
So it's sounding sort of like firefox just has a race condition going on or something.
Fortunately, jcristau gave a response on the upstream bug. He indicates that BadWindow is indeed an appropriate response from the xserver in this case, and is returned when the Window parameter passed to XQueryTree is invalid. I've requested that the XQueryTree man page be updated with this info, and we can consider the libx11 task resolved once that is completed.
So it's sounding sort of like firefox just has a race condition going on or something.