Re: XForms: Xforms as a plugin

Andy Bruss (abruss@anim.dreamworks.com)
Wed, 01 Apr 1998 18:24:30 -0800

# To subscribers of the xforms list from Andy Bruss <abruss@anim.dreamworks.com> :

Steve Lamont wrote:
>
> # To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
>
> > Specially, I'd like a non-modal window to pop up in a 3D package and
> > have the user be able to interact with both the xforms window and the 3D
> > package at the same time. I'm already using fl_check_forms(); it seems
> > to work ok if the cursor is in the 3D package's main window. I've added
> > an Xevent handler through the package's API which simply calls
> > fl_check_forms(), so things are as expected if the cursor in the in the
> > 3D pkg.'s main window. ...
>
> A bunch more questions:
>
> Are you actually handling the events in the 3D app? Is the app
> "eating" the events? Are you using XPutBackEvent() to stuff the event
> back in the queue?
The 3D app API allows me to install a callback/handler which is
executed before any of the 3D apps.' Xevent processing. I believe the
function is analogous to the xforms fl_set_event_callback(). The 3D
app. ends up "eating" the events in the end.

> Does your app make a separate display connection? How is it actually
> processing the events? With XNextEvent()?
My plugin doesn't create a new display connection (unless
fl_initialize() or xforms in general does this).

> Does the app separately process its own events? If so, how does it
> discriminate between the events that it "owns" and those that XForms
> "owns?"
The handler callback that I install must return 1 if the event is to
be handled by the 3D app. Otherwise, it must return 0 indicating the
event was handled.

> > May initial thinking was that this problem was caused from not parenting
> > the xforms window to the 3D application. Is this correct? ...
>
> If you mean reparent in the sense of the XReparentWindow() call, then,
> no, I don't think so.
>
> Is the 3D app an X application, too? I suspect that what's happening
> is that you have two event handlers contending for the same event
> queue.
I believe you're right, but I'm not sure how to resolve the
situation. The 3D app. is an X application... based on the Xt library I
think. I don't think it uses Motif, but I could be wrong.

> Exactly why XForms blocks when it has focus in its own window is hard
> to determine. Perhaps when the 3D app loses focus it for some reason
> suspends event handling, though I'm just speculating and I'd be hard
> pressed to explain why.

My thinking was that when I call fl_initialize() or fl_show_form()
later, I'm not able to say that the new window should be a child of the
3D app. Does the new window get parented to root?

-Andy

-- 
--------------------------------------------------------------------------
Andy Bruss                          
Software Development                   
Dreamworks Animation
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil   or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/