Path: utzoo!utgpu!watserv1!watmath!att!pacbell.com!ames!sun-barr!apple!agate!graft!scott From: scott@graft.Berkeley.EDU (Scott Silvey) Newsgroups: comp.windows.x Subject: Re: WM_SAVE_YOURSELF Message-ID: <1991Jan25.201354.17242@agate.berkeley.edu> Date: 25 Jan 91 20:13:54 GMT References: <1991Jan22.064227.4656@agate.berkeley.edu> <100920280@hpcvlx.cv.hp.com> Sender: usenet@agate.berkeley.edu (USENET Administrator) Reply-To: scott@xcf.berkeley.edu Organization: UC Berkeley Experimental Computing Facility Lines: 43 dex@hpcvlx.cv.hp.com (Dex Smith) writes: |> In your first message, you mention that you are testing your "save yourself" |> callback by choosing the Close command in the window menu. The "save |> yourself" protocol described in ICCCM is intended for use with session |> managers, and is not related to the Close button. Thank you for your volumous and clearly outlined response! Unfortunately, you didn't quite adress my questions which is no doubt due to the briefness of my second posting (the first one was more thorough and included a program which illustrates the problem I am having with WM_SAVE_YOURSELF). Here is the behavior I am actually seeing from mwm: When one selects the "Close" command, mwm checks for the two protocols WM_DELETE and WM_SAVE_YOURSELF. If neither is supported, mwm gets rather fascist and simply whacks the client's X connection. When WM_DELETE is noted in the WM_PROTOCOLS property, mwm sends the WM_DELETE message and doesn't bother the client again, assuming that it will be socially compliant and attempt to shut itself down. I am able to get this mechanism to work properly. When WM_SAVE_YOURSELF (and not WM_DELETE) is noted, the window manager sends the WM_SAVE_YOURSELF message, unmaps the client's window, and then appears to wait for a client response. If the client responds, the application quits by some mysterious mechanism after the WM_SAVE_YOURSELF callback returns. If the client does NOT respond, the client gets wasted anyway. MY QUESTION IS: How do I prevent my application from getting blown away by the WM_SAVE_YOURSELF mechanism? Is this even possible according to ICCC? (I thought it was, but perhaps I am reading ICCCM wrong?). What I would like to do is prompt the user with a dialog box that says "Do you really want me to quit?" and if the user clicks "No", then I'd like to go on with life and not get killed (Or have my window unmapped for that matter!). /-----------------------------------------------------------------------------\ | Scott Silvey | Ronald Reagan on Pac Man: | | scott@xcf.berkeley.edu | "Someone told me it was a round thing that gobbles | | Flames to /dev/null. | up money, but I thought that was Tip O'Neill." | \-----------------------------------------------------------------------------/