Withdraw.c revision 1ab64890
1/* $Xorg: Withdraw.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ 2 3/*********************************************************** 4Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., 5 6 All Rights Reserved 7 8Permission to use, copy, modify, and distribute this software and its 9documentation for any purpose and without fee is hereby granted, 10provided that the above copyright notice appear in all copies and that 11both that copyright notice and this permission notice appear in 12supporting documentation, and that the name Wyse not be 13used in advertising or publicity pertaining to distribution of the 14software without specific, written prior permission. 15 16WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 17ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 18DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 19ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 20WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 22SOFTWARE. 23 24******************************************************************/ 25/* 26 27Copyright 1988, 1998 The Open Group 28 29Permission to use, copy, modify, distribute, and sell this software and its 30documentation for any purpose is hereby granted without fee, provided that 31the above copyright notice appear in all copies and that both that 32copyright notice and this permission notice appear in supporting 33documentation. 34 35The above copyright notice and this permission notice shall be included 36in all copies or substantial portions of the Software. 37 38THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 39OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 40MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 41IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 42OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 43ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 44OTHER DEALINGS IN THE SOFTWARE. 45 46Except as contained in this notice, the name of The Open Group shall 47not be used in advertising or otherwise to promote the sale, use or 48other dealings in this Software without prior written authorization 49from The Open Group. 50 51*/ 52 53#define NEED_EVENTS 54#ifdef HAVE_CONFIG_H 55#include <config.h> 56#endif 57#include <X11/Xlibint.h> 58#include <X11/Xatom.h> 59#include <X11/Xos.h> 60#include <X11/Xutil.h> 61#include <stdio.h> 62 63/* 64 * This function instructs the window manager to change this window from 65 * NormalState or IconicState to Withdrawn. 66 */ 67Status XWithdrawWindow ( 68 Display *dpy, 69 Window w, 70 int screen) 71{ 72 XUnmapEvent ev; 73 Window root = RootWindow (dpy, screen); 74 75 XUnmapWindow (dpy, w); 76 77 ev.type = UnmapNotify; 78 ev.event = root; 79 ev.window = w; 80 ev.from_configure = False; 81 return (XSendEvent (dpy, root, False, 82 SubstructureRedirectMask|SubstructureNotifyMask, 83 (XEvent *)&ev)); 84} 85