Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!linus!progress!mikep From: mikep@progress.COM (Mike Pacholec) Newsgroups: comp.windows.x Subject: Re: Interrupting an X program... how? Message-ID: <1991Mar2.183352.29822@progress.com> Date: 2 Mar 91 18:33:52 GMT References: <1991Mar1.045842.21676@contact.uucp> Sender: news@progress.com (The News User) Organization: Progress Software Corp., Bedford, MA Lines: 37 Nntp-Posting-Host: mikep egr@contact.uucp (Gordan Palameta) writes: >A traditional program under Unix can be interrupted by hitting Control-C >(or whatever other character defined by stty). > >How do you send a signal to an X program? > >Specifically, a program which goes off and does lengthy >calculations, and doesn't check for X events until the calculations >are complete. > >Recasting this (existing) program to check for X events during the >aforesaid lengthy computations is not really an option (among other >things, the computations are in Fortran). :-( > >So how can I arrange for the window manager or whatever to send a signal >to a program running in an X window? You are responsible for emulating the control-c functionality yourself. Outside of polling, the options aren't pretty. On BSD systems, you can arrange to have SIGIO sent to your program when data is ready on the display connection. The signal handler can then query the event queue and check for control-c. This way, you only check for control-c when some event arrives. It is also possible to have a partner process monitor your client's event queue. If the partner process sees a control-c, then it can SIGINT your client. I haven't seen any other suggestions. -- ------------------------------------------------------------------------------- Mike Pacholec UUCP: mit-eddie!progress!mikep Progress Software Corp. Internet: mikep@progress.com Bedford, MA