Xref: utzoo comp.emacs:7655 comp.windows.x:17819 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!samsung!uunet!mcsun!hp4nl!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.emacs,comp.windows.x Subject: Trying to iconize X-emacs Message-ID: <4292@mhres.mh.nl> Date: 1 Feb 90 10:36:21 GMT Followup-To: comp.emacs Organization: Multihouse NV, the Netherlands Lines: 42 Hi, I'm trying to provide an emacs function which will have it iconized when running under X. So I built the following function in x11fns.c: DEFUN ("x-iconify-window", Fx_iconify_window, Sx_iconify_window, 0, 0, 0, "Iconifies the X window.") () { if (WindowMapped) { XEvent evt; evt.xclient.type = ClientMessage; evt.xclient.display = XXdisplay; evt.xclient.window = XXwindow; evt.xclient.message_type = XInternAtom (XXdisplay, "WM_CHANGE_STATE", False); evt.xclient.format = 32; evt.xclient.data.l[0] = IconicState; XSendEvent (XXdisplay, XDefaultRootWindow (XXdisplay), False, (SubstructureRedirectMask | SubstructureNotifyMask), &evt); XFlush(XXdisplay); } return Qnil; } However, when I call x-iconify-window, the emacs process exits without warning on the 'XSendEvent' call. This iconify function is known to work well in other programs, though. Any help? Johan -- Johan Vromans jv@mh.nl via internet backbones Multihouse Automatisering bv uucp: ..!{uunet,hp4nl}!mh.nl!jv Doesburgweg 7, 2803 PL Gouda, The Netherlands phone/fax: +31 1820 62944/62500 ------------------------ "Arms are made for hugging" -------------------------