00001 /* $Xorg: UpdMapHint.c,v 1.4 2001/02/09 02:03:53 xorgcvs Exp $ */ 00002 00003 /* 00004 00005 Copyright 1989, 1998 The Open Group 00006 00007 Permission to use, copy, modify, distribute, and sell this software and its 00008 documentation for any purpose is hereby granted without fee, provided that 00009 the above copyright notice appear in all copies and that both that 00010 copyright notice and this permission notice appear in supporting 00011 documentation. 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00019 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00022 00023 Except as contained in this notice, the name of The Open Group shall not be 00024 used in advertising or otherwise to promote the sale, use or other dealings 00025 in this Software without prior written authorization from The Open Group. 00026 00027 */ 00028 /* $XFree86: xc/lib/Xmu/UpdMapHint.c,v 1.6 2001/01/17 19:42:57 dawes Exp $ */ 00029 00030 /* 00031 * Author: Jim Fulton, MIT X Consortium 00032 */ 00033 00034 #include <stdio.h> 00035 #include <X11/Xlib.h> 00036 #include <X11/Xutil.h> 00037 #include <X11/Xmu/WinUtil.h> 00038 00039 Bool 00040 XmuUpdateMapHints(Display *dpy, Window w, XSizeHints *hints) 00041 { 00042 static XSizeHints *shp = NULL; 00043 00044 if (!hints) { /* get them first */ 00045 long supp; 00046 00047 if (!shp) { 00048 shp = XAllocSizeHints(); 00049 if (!shp) return False; 00050 } 00051 if (!XGetWMNormalHints (dpy, w, shp, &supp)) return False; 00052 hints = shp; 00053 } 00054 hints->flags &= ~(PPosition|PSize); 00055 hints->flags |= (USPosition|USSize); 00056 XSetWMNormalHints (dpy, w, hints); 00057 return True; 00058 } 00059
1.5.1