| 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 <nx-X11/Xlibint.h> |
| 56 |
#include <nx-X11/Xatom.h> |
| 57 |
#include <nx-X11/Xos.h> |
| 58 |
#include <nx-X11/Xutil.h> |
| 59 |
#include <stdio.h> |
| 60 |
|
| 61 |
/* |
| 62 |
* This function instructs the window manager to change this window from |
| 63 |
* NormalState to IconicState. |
| 64 |
*/ |
| 65 |
Status XIconifyWindow ( |
| 66 |
Display *dpy, |
| 67 |
Window w, |
| 68 |
int screen) |
| 69 |
{ |
| 70 |
Atom prop; |
| 71 |
|
| 72 |
prop = XInternAtom (dpy, "WM_CHANGE_STATE", False); |
| 73 |
if (prop == None) |
| 74 |
return False; |
| 75 |
else { |
| 76 |
XClientMessageEvent ev = { |
| 77 |
.type = ClientMessage, |
| 78 |
.window = w, |
| 79 |
.message_type = prop, |
| 80 |
.format = 32, |
| 81 |
.data.l[0] = IconicState |
| 82 |
}; |
| 83 |
Window root = RootWindow (dpy, screen); |
| 84 |
|
| 85 |
return (XSendEvent (dpy, root, False, |
| 86 |
SubstructureRedirectMask|SubstructureNotifyMask, |
| 87 |
(XEvent *)&ev)); |
| 88 |
} |
| 89 |
} |