[GRASS5] Re: max res. PPM image dump from NVIZ

Glynn Clements glynn.clements at virgin.net
Sat Aug 28 17:21:48 EDT 2004

Glynn Clements wrote:

> > > > X Error of failed request:  GLXBadContextTag
> > > >   Major opcode of failed request:  144 (GLX)
> > > >   Minor opcode of failed request:  1 (X_GLXRender)
> > > >   Serial number of failed request:  3736
> > > >   Current serial number in output stream:  3737
> > > 
> > > I can't reproduce this with 5.3, and I don't have an up-to-date 5.7
> > > built right now. Can you see if it happens for you with 5.3?
> > 
> > Happens both with the latest 5.3 and 5.7.
> > 
> > Just after it finishes writting the PPM, the low-res 'grid' is drawn,
> > but the southern 10-15% is missing. When you change the view angle you
> > are looking at a blank screen, when you finish it redraws the hi-res
> > 'polygon' version ok.
> > 
> > -> Resizing the viewing window causes the above error (& crash).
> I can't reproduce this.

However, I have re-discovered something which could cause problems:

	# Set the cancel function for drawing
	Nset_cancel_func update

Essentially, this means that Tk's event-processing code will be called
repeatedly throughout the drawing process. If this results in the Togl
widget receiving configure/expose/etc events, Togl will reinstate the
original (on-screen) GLX context, with unpredictable results.

Try commenting out the above line (in nviz2.2_script), and see if the
problems still occur.

The reason for the above is so that the UI doesn't "freeze" while
time-consuming operations in progress. However, it also introduces
serious reliability issues; any code which calls GS_check_cancel
(which includes the drawing code) has to allow for the fact that it
can result in arbitrary changes to the program's state (e.g. the GLX
context suddenly changing, windows being moved/resized/deleted, etc).

Essentially, it's one of those things which probably seemed like a
good idea at the time (to someone who hadn't actually considered the
consequences), but isn't.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list