Re: Need help debugging Gdk-ERROR



On Sat, 17 Mar 2001, Havoc Pennington wrote:
> "Eric M. Monsler" <emonsler beamreachnetworks com> writes: 
> > Any guesses as to what could be occurring, that might cause different
> > behavior with '--sync' or not?  
> > 
> > Maybe, creating something and trying to act on it too soon, before it is
> > 'realized', but --sync causes the Xserver to allocate the resources
> > immediately?
> > 
> 
> Right, there's conceivably some kind of race condition. 
> 
> You can manually ensure that you're synced at a given point with
> gdk_flush(), could help experiment.

How many places are you calling gdk_draw_points() from in your code anyway?
I don't know if any other Gdk routines call this internally, but you could
certainly start by looking at your calls. A gdk_flush() immediately after the
call might produce helpfull results, so might printing out the X resource ID
using GDK_WINDOW_XWINDOW(drawable). You need to include <gdk/gdkx.h> to use this
macro. You could even get fancy and use the internal resource tracking to see
if the resource ID was ever allocated:

You can get the Xdisplay with GDK_WINDOW_XDISPLAY(drawable), then
dpy->resource_base is the first ID allocated by this client and
dpy->resource_base + (dpy->resource_id - 1 << dpy->resource_shift) is the last.

This will at least tell you whether the problem is that the window has been
destroyed, never allocated or is complete rubbish.

Warning: all the above is written from theory; I've never needed to do quite
this, so I could easily have got it completely wrong. It's also not even
vaguely portable, so might not work on your system anyway (I use Linux).

-- 
Ali Harlow                              Email: ali avrc city ac uk
Research programmer                     Tel:   (020) 7477 8000 X 4348
Applied Vision Research Centre          Intl: +44 20 7477 8000 X 4348
City University                         Fax:   (020) 7505 5515
London                                  Intl: +44 20 7505 5515




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]