Withdraw.c revision 1ab64890
11ab64890Smrg/* $Xorg: Withdraw.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ 21ab64890Smrg 31ab64890Smrg/*********************************************************** 41ab64890SmrgCopyright 1988 by Wyse Technology, Inc., San Jose, Ca., 51ab64890Smrg 61ab64890Smrg All Rights Reserved 71ab64890Smrg 81ab64890SmrgPermission to use, copy, modify, and distribute this software and its 91ab64890Smrgdocumentation for any purpose and without fee is hereby granted, 101ab64890Smrgprovided that the above copyright notice appear in all copies and that 111ab64890Smrgboth that copyright notice and this permission notice appear in 121ab64890Smrgsupporting documentation, and that the name Wyse not be 131ab64890Smrgused in advertising or publicity pertaining to distribution of the 141ab64890Smrgsoftware without specific, written prior permission. 151ab64890Smrg 161ab64890SmrgWYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 171ab64890SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 181ab64890SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 191ab64890SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 201ab64890SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 211ab64890SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 221ab64890SmrgSOFTWARE. 231ab64890Smrg 241ab64890Smrg******************************************************************/ 251ab64890Smrg/* 261ab64890Smrg 271ab64890SmrgCopyright 1988, 1998 The Open Group 281ab64890Smrg 291ab64890SmrgPermission to use, copy, modify, distribute, and sell this software and its 301ab64890Smrgdocumentation for any purpose is hereby granted without fee, provided that 311ab64890Smrgthe above copyright notice appear in all copies and that both that 321ab64890Smrgcopyright notice and this permission notice appear in supporting 331ab64890Smrgdocumentation. 341ab64890Smrg 351ab64890SmrgThe above copyright notice and this permission notice shall be included 361ab64890Smrgin all copies or substantial portions of the Software. 371ab64890Smrg 381ab64890SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 391ab64890SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 401ab64890SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 411ab64890SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 421ab64890SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 431ab64890SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 441ab64890SmrgOTHER DEALINGS IN THE SOFTWARE. 451ab64890Smrg 461ab64890SmrgExcept as contained in this notice, the name of The Open Group shall 471ab64890Smrgnot be used in advertising or otherwise to promote the sale, use or 481ab64890Smrgother dealings in this Software without prior written authorization 491ab64890Smrgfrom The Open Group. 501ab64890Smrg 511ab64890Smrg*/ 521ab64890Smrg 531ab64890Smrg#define NEED_EVENTS 541ab64890Smrg#ifdef HAVE_CONFIG_H 551ab64890Smrg#include <config.h> 561ab64890Smrg#endif 571ab64890Smrg#include <X11/Xlibint.h> 581ab64890Smrg#include <X11/Xatom.h> 591ab64890Smrg#include <X11/Xos.h> 601ab64890Smrg#include <X11/Xutil.h> 611ab64890Smrg#include <stdio.h> 621ab64890Smrg 631ab64890Smrg/* 641ab64890Smrg * This function instructs the window manager to change this window from 651ab64890Smrg * NormalState or IconicState to Withdrawn. 661ab64890Smrg */ 671ab64890SmrgStatus XWithdrawWindow ( 681ab64890Smrg Display *dpy, 691ab64890Smrg Window w, 701ab64890Smrg int screen) 711ab64890Smrg{ 721ab64890Smrg XUnmapEvent ev; 731ab64890Smrg Window root = RootWindow (dpy, screen); 741ab64890Smrg 751ab64890Smrg XUnmapWindow (dpy, w); 761ab64890Smrg 771ab64890Smrg ev.type = UnmapNotify; 781ab64890Smrg ev.event = root; 791ab64890Smrg ev.window = w; 801ab64890Smrg ev.from_configure = False; 811ab64890Smrg return (XSendEvent (dpy, root, False, 821ab64890Smrg SubstructureRedirectMask|SubstructureNotifyMask, 831ab64890Smrg (XEvent *)&ev)); 841ab64890Smrg} 85