Xref: utzoo comp.windows.x.motif:2809 comp.windows.x:36101 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!apple!voder!nsc!taux01!pilat!amir From: amir@taux01.nsc.com (Amir J. Katz (Xpert)) Newsgroups: comp.windows.x.motif,comp.windows.x Subject: WM_PROTOCOLS question Message-ID: Date: 6 May 91 13:26:38 GMT Sender: amir@pilat.Silvaco.Com Followup-To: Killing X Softly Distribution: comp Organization: Silvaco Israel Ltd. Lines: 42 Following my previous inquiry how to kill X softly, it was pointed out that the ugly messages from dying clients happen because these clients do not handle the Motif's f.close event at all. I am trying to make a small Xm/Xt test program handle this protocol. As I understand from the manuals, I need to add a window manager protocol, but I can't get it to work. Here is the relevent code segments: Atom protocols[10]; Widget toplevel; int n; ... toplevel = XtInitialize (argv[0], "test", NULL, 0, &argc, argv); ... n=0; protocols[n] = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW", False); n++; protocols[n] = XInternAtom (XtDisplay(toplevel), "WM_SAVE_YOURSELF", False); n++; XmAddWMProtocols (toplevel, protocols, n); I have looked into one of OSF/Motif 1.0.A test cases (atoms_gb.c) which does work, but it's too complex. Isolating the relevent parts did not help. The same theme works if I use X primitives: main_wid = XCreateWindow (display,... status = XSetWMProtocols (display, main_wid, protocols, n); My questions are: 1. Do I need to add the protocols to a VendorShell or any shell widget will do? 2. How can I make it work in Xt/Xm applications? -- Thanks in advance - please email to address below. -- Amir J. Katz, System Manager Internet: amir%pilat.UUCP@taux01.nsc.com UUCP: {decwrl,uunet,...}!nsc!taux01!amir Phone: +972 52-570713 Fax: +972 52-570719 Snail-mail: Amir J. Katz, Silvaco Israel Ltd. 19 Maskit St., Herzelia, Israel 46733