[comp.windows.x] Graphics in response to UNIX signals in the Xt intrinsics

frose@synoptics.com (Flavio Rose) (11/09/90)

Followup-To: 
Distribution: world
Organization: SynOptics Communications Inc. Santa Clara, Ca.
Disclaimer: Sender is *solely* responsible for the contents of message
Keywords: 

Can a program based on the X Toolkit Intrinsics reliably
perform a graphic operation (e.g. XtManageChild) in
response to the receipt of a UNIX signal?

It is my understanding that it is not safe to directly call
things like XtManageChild inside a UNIX signal handler.
Right?  So the handler has to set a flag which is
interpreted by some other piece of code that actually does
the graphics.

Unfortunately I can't figure out how to arrange for this
other piece of code to be called. The best approximation I
can come up with is to have this code called every so often
via XtAppAddTimeout. Without timeouts, I can't see any way
to wake up XtAppNextEvent from its slumber when the signal
occurs. (I've looked at the code in
src/mit/lib/Xt/NextEvent.c from X11R4... as best I can
tell, if EINTR wakes it up and no timeout has expired, it
goes right back to sleep by calling select once again.)

In XView terms, what I am looking for is an equivalent to
notify_set_signal_func with NOTIFY_SYNC.

Any advice would be most appreciated. The target OS is
SunOS, but we want to remain portable to other UNIX
versions.

Flavio Rose
SynOptics Communications, Inc.
frose@synoptics.com