Well, my first post... thanks in advance!
Can applications be notified of the X Window close (with "X" button) so the signal handler can run a cleanup process method?
About the app: built with GNU C/C++ on Solaris 10, with WxWidgets. It is launched by a shell script as a background task. The app becomes 'orphaned', a child of init (i think), because of fork/exec code...
The app acts as a controller, launching other apps, etc... We track the number of active users, by modifying a value in shared memory. On a normal entry and exit we modify the value...
Problem scenario: When you click the "X" on the X terminal window that launched the controller app, the controller app and everything it launched is killed... but it doesn't look like the signal handler is being notified of an event...
Should i be getting a SIGHUP or other signal? something special from the window manager?
If I type 'exit' in the controlling X terminal, then the logout kills the interactive shell but the X Window remains open... processes running still...
would love code snippets... thanks, Jim