Hamish wrote:
> > does dumping a max. res PPM work for anyone on MacOSX from NVIZ? not
> > me, I just get the bits.
>
> Can you elaborate?
Then, next time I change a knob and redraw the NVIZ display, it breaks:
X Error of failed request: GLXBadContextTag
Major opcode of failed request: 144 (GLX)
Minor opcode of failed request: 1 (X_GLXRender)
I get exactly the same thing, but right away.
I'm pretty sure I know what's causing it.
Create_OS_Ctx() stores the current drawable an GLX context, and
Destroy_OS_Ctx() restores them. The problem is that the code in
do_zoom.c opens another connection to the X display itself. From the
perspective of the X server, do_zoom.c is a separate client to the
rest of NVIZ. And from the perspective of Xlib, the Display used by
do_zoom.c is a different display to the one which is used by the rest
of NVIZ.
IOW, do_zoom.c shouldn't be trying to do anything with NVIZ' X
resources, because they belong to a different client and a different
display.
If do_zoom.c wants to create its own X connection (even to a different
X server), its own GLX context, and its own X/GLX resources, that's
fine, and it should all work.
If I change the glXMakeCurrent() call which attempts to restore the
old context to simply release the existing context, then it doesn't
crash. However, subsequently moving the viewpoint etc doesn't result
in the display being redrawn (because there isn't a current context).
But if you resize the view window, everything then works again
(presumably, Togl explicitly restores the context as part of the
resize handling).
AFAICT, the correct solution is to force Togl to restore the context
before each redraw, and for do_zoom.c to not to access X resources
(window, GLX context) which belong to a different client and a
different display.
Try the attached patch.
--
Glynn Clements <glynn.clements@virgin.net>
(attachments)
diff.txt (2.07 KB)