[Xcb] OK to ignore BadWindow errors?

Donald Ephraim Curtis dcurtis at cs.uiowa.edu
Mon Jul 27 08:48:02 PDT 2009


I think it's on the same connection.

I'm doing some weird stuff because I am writing in Python and I have
wrapped a lot of the xcb functions myself because I want to use Cairo to
do drawing.  The trick I do is that I create the connection on the C
side then I wrap it using a function that xpyb provides.  This way I
*believe* I am sharing the connection on both ends.

It's really weird because when I removed my updating commands,
then it didn't give me those errors.  I think the race condition is
actually that I monitor the xcb connection for 1 second, then if nothing
comes up, I update some data internally and cause a refresh of the data
(this causes some widgets to update and also the systray icons to move
position) and THEN I go back to handling events.  In the meantime the
destroy event may have come in and thus the call to update the window
will have a bad window element because that window was destroyed before
having the ability to process that event.

I think that if I rethink my event loop I may be able to avoid these
problems but I don't think they are hurting anything.  I mean, the
window is gone and it only happens once, it's not reoccuring, so I don't
know that it's hurting anything.

(Mon, Jul 27, 2009 at 11:35:49AM -0400) Peter Harris <pharris at opentext.com>:
> Donald Ephraim Curtis wrote:
> > When I get a new systray window request I reparent it under my main
> > window.  This works OK until the window is destroyed and then it looks
> > like there are extraneous events that get pushed through AFTER the
> > destroy event is called.  
> 
> This is on different connections? Yeah, it's almost impossible to avoid
> this sort of race when using separate connections.
> 
> > So is it OK practice to ignore these???
> 
> Yes. X11 errors are advisory, not fatal.
> 
> Peter Harris
> -- 
>                Open Text Connectivity Solutions Group
> Peter Harris                    http://www.opentext.com/connectivity
> Research and Development        Phone: +1 905 762 6001
> pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list