Re: Colormaps, etc.

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 4 Dec 96 17:32:50 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I have written a program that opens a glcanvas (on a form) and displays
> an image under Xforms 0.81 (Irix 5.3). If another image is loaded the form is
> hidden and then resized using:
> [...]
> This all works and the images are displayed correctly in a framed form;
> however, when I run this program on a remote machine and display it
> on my local machine (Yes both machines have GLX extensions
> Indy->Indigo^2) a GLXBadCurrentWindow error occurs. ...

If you're using fl_hide_form() then XForms does an XDestroyWindow()
when the form is hidden. This means that in the case of a Canvas
object, which is the only XForms object that currently instantiates a
child Window, the Canvas Window is also destroyed, since
XDestroyWindow() traverses the Window tree from bottom to top,
destroying all Windows as it goes.

My guess in the local case is that X and GL create a new Canvas Window
that fortuitously has the same XID as the old window, while in the
remote case, you get a different XID and, therefore, the GLX error.

You can work around by issuing

XUnmapWindow( fl_display(), form->window );

and

XMapWindow( fl_display(), form->window );

instead of fl_hide_form()/fl_show_form().

As I said in a recent posting, IMHO, the behavior of fl_hide_form() is
something of a misfeature, though I can see (sort of) why it was done.

spl
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html