Re: Force Quit button
- From: Mark McLoughlin <mark skynet ie>
- To: Alan <alan ufies org>
- Cc: Desktop Devel <desktop-devel-list gnome org>
- Subject: Re: Force Quit button
- Date: 14 May 2003 11:47:46 +0100
Hey,
On Tue, 2003-05-13 at 17:39, Alan wrote:
> On Tue, May 13, 2003 at 05:11:45PM +0100, Mark McLoughlin wrote:
> > Hey,
> >
> > On Tue, 2003-05-13 at 17:01, Jonathan Blandford wrote:
> > > Mark McLoughlin <mark skynet ie> writes:
> > >
> > > > Hey,
> > > > I've just added a "Force Quit" button to gnome-panel HEAD[1]. Its
> > > > basically just a nicer version of an xkill launcher.
> > >
> > > Ugh. That doesn't seem so nice. If you have a runaway process, surely
> > > gnome-system-monitor is the way to go. Having a "Possibly but not
> > > necessarily kill broken legacy Apps" on the desktop seems like a bad
> > > idea.
> >
> > Yeah, I don't particularily like it either. That's why I haven't put it
> > in the Actions menu or anything silly like that ... its just a button
> > you can add to the panel.
>
> IIRC Metacity already has a "app has not responded" dialoge that as
> mentioned before, may or may not kill an app or separate it from the X
> server. Maybe give the option in that dialoge of "force kill" (running
> the xkill) as well as "nicely kill" (what it does now)?
Hmm - I'll try and explain again:
Basically, "closing a window, figuring out whether the app is
responding it and killing it if it isn't repsonding" depends on support
for the WM_DELETE and _NET_WM_PING protocols and the app setting the
_NET_WM_PID property on its windows.
So, there's various combinations of app support:
1) The app doesn't support either protocol
2) The app supports WM_DELETE_WINDOW only
3) The app supports WM_DELETE_WINDOW and _NET_WM_PING
4) Ditto, but also sets _NET_WM_PID
The way metacity handles the user trying to close a window depending on
the above is summarised by the pseudo code:
if (supports_wm_protocol (window, WM_DELETE_WINDOW)
send_wm_delete_window_message (window)
else
XKillClient (window);
if (supports_wm_protocol (window, _NET_WM_PING))
if (send_net_wm_ping_message (window) == no_reply)
if (pop_up_delete_dialog_question (window) == delete)
{
if (on_same_host (window) && has_pid_prop_set (window))
kill (window->pid, SIGKILL)
XKillClient (window);
}
So, basically what this means is if the user clicks on "close" s/he is
guaranteed to actually get the window close unless the app supports
WM_DELETE_WINDOW but *not* _NET_WM_PING. Unfortunately, this covers a
large section of legacy apps and this is the case we need to cater for
somehow, imho.
Note also, you are only guaranteed to get the window closed *and* the
process quit iff WM_DELETE_WINDOW and _NET_WM_PING are supported and the
_NET_WM_PID property is set and the app is running on the same machine.
Phew :/
Good Luck,
Mark.
P.S. - in http://bugzilla.gnome.org/show_bug.cgi?id=104023 there's a
test app for testing out these different behaviours. To simulate an app
which isn't responding run it with -d -p. To test the different app
scenarios above:
1) --disable-delete-support --disable-ping-support
2) --disable-ping-support
3) --disable-net-wm-pid
4) (no args apart from -d and -p)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]