Re: WM_DELETE_WINDOW



On Sun, Nov 21, 1999 at 08:20:30PM +0100, Matthias Ettrich wrote:
> 
> Hi, 
> 
> WM_DELETE_WINDOW is a nice WM protocol, but far from sufficient.
> 
> One of the standard questions of new X users is: "what to do with a program that
> hangs and therefore doesn't close when I click on the close button?"
> 
> Overcoming this limitation is difficult. One solution is the fvwm way to
> put the burden onto the user and to provide two entries "quit" and "close" in
> the window operation menu (at least my old fvwm used to have this in its default
> configuration). Disadvantage: the difference between quit and close is hard to
> document and will hardly be understood by any normal user. And frankly, it's a
> purely technical thing the interface should hide. 

And fvwm can hide it for you.  The 'close' function first tries
to be nice and uses the WM_DELETE_WINDOW protocol, but if this
fails it uses XKillClient.  Is more than this necessary?  I mean,
if the application doesn't react to the request the chance is very
slim that it's still alive (?).  Wouldn't it be enough if the
application had some way to 'reply' to the WM_DELETE_WINDOW
request to tell the WM that it's still alive and trying to shut
whut down (but can't comply immediately because e.g. it's
displaying a 'save-and-exit' dialog)?

> The KDE way is to provide "quit" only, but offer a process manager and a
> kill-window function in addition. But using these things requires at least
> reading some documentation.
> 
> My suggestion is to add a new wm protocol, NET_WM_PING:
> type = ClientMessage
> window = client window
> message_type = WM_PROTOCOLS
> format = 32
> data.l[0] = NET_WM_PING
> data.l[1] = opaque handle set by the window manager to identify the ping
> 
> The client that recieves this message is obliged to send it back to the root
> window immediatly ( set window=root and do a XSendEvent ).
> 
> 
> With this protocol, the window manager has the possibility to issue a ping
> right before sending the WM_DELETE message. If the reply doesn't arrive within
> say 4 seconds it can display a message box: "The application doesn't react,
> shall I kill it? [kill] [try again][cancel] "
> 
> Of course this procedures only works for clients that request the new wm
> protocol, but that's better than nothing.

Bye

Dominik ^_^

--
Dominik Vogt, dominik.vogt@gmx.de
Reply-To: dominik.vogt@gmx.de



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