Re: XForms: Hourglass: A tip and a question

Steve Lamont (
Thu, 10 Jul 97 09:11:31 PDT

To subscribers of the xforms list from (Steve Lamont) :

> Now to the question. From time to time I get the following error:
> X Error of failed request: BadWindow (invalid Window parameter)
> Major opcode of failed request: 2 (X_ChangeWindowAttributes)
> It doesn't occur very frequently, but sometimes after an
> fl_show_alert(). Am I misusing fl_winget() or fl_get_display(), or am I
> doing something else hair-raising?

You may not be getting the correct Window XID. It sounds as if
there's a race condition that confuses fl_winget(). It may be getting
the Window XID of the alert window rather than the current active
window depending upon how quickly things get destroyed.

I'd suggest pointing your cursor routine at an object which is known
to exist.

This is similar (but not really the same), I think, to the double
buffer problem I had a couple of days ago.

Here's the hack that TC sent me to get the real Window XID:

Window get_real_object_window( FL_OBJECT *ob )


FL_pixmap *objp = ob->flpixmap;
FL_pixmap *formp = ob->form->flpixmap;

return (objp && objp->win) ? objp->win :
((formp && formp->win) ? formp->win : FL_ObjWin(ob) );


I implemented my cursor handler as follows:

void set_form_object_cursor( FL_OBJECT *obj, int cursor )


fl_set_cursor( get_real_object_window( obj ), cursor );



To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: