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