discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Force Quit for GNUstep


From: Richard Frith-Macdonald
Subject: Re: Force Quit for GNUstep
Date: Fri, 7 Jul 2006 04:51:32 +0100


On 7 Jul 2006, at 01:23, Fred Kiefer wrote:

Andreas Höschler schrieb:
on the Mac we have this Force Quit panel to kill applications that no
longer respond to events. Does something equivalent exist for GNUstep?
We developers use a terminal session and kill but that's no suitable
appproach for our mums and dads or possibly customers.


There is a specific X protocol (_NET_WM_PING) that is supposed to handle
this case and would allow the window manager to determine that a
specific applications is currently no longer responding. I always wanted
to implement this for GNUstep, but never did get around to it.

That would be a very useful feature for window manager interaction and playing nicely with X applications, but I'm not sure it's what the original question was about.

Is the problem to determine whether an application is still responding, or is the problem to shut down an application, or is it a combination of both (to shut down the application if, and only if, it is not responding)?

To see if an application is responding, you can attempt to make a DO connection to it. To shut down a responding application ... you tell it to shut down over the DO connection. For these first two, the code in http://svn.gna.org/viewcvs/gnustep/ libs/gui/trunk/Tools/gclose.m (and gcloseall.m) provides an implementation/example. To close down a process which is not responding, you have to send it a signal (TERM, and QUIT if TERM does not work) ... don't know what you do on windows though.

I think the equivalent of the MacOS-X 'force quit' panel would be a small gnustep application which would use the NSWorkspace class to determine what apps are running, and display them in a list. When the panel is made visible (and at intervals while visible), it would try to make a DO connection to each app it lists ... if a DO connection cannot be established in a reasonable time, the corresponding entry in the list would be flagged as 'not responding'. The user would be able to select any application and click a button to terminate it. If the application is responding, the termination would be a clean, orderly shutdown via a DO request, if not, it would be done using the signal() system call (or windows equivalent). Once shut down, the application would be removed from the list.

Presumably implementing support for _NET_WM_PING would allow you to write something similar as a pure X application, but without the option of termintating applications cleanly, just shutting them down via signal()

This makes me think ... we should probably (if we don't already) have the X backend trap SIGTERM and try to do a clean shutdown if an app receives it.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]