Xref: utzoo comp.os.vms:27255 comp.windows.x:23689 Path: utzoo!attcan!uunet!lll-winken!uwm.edu!zaphod.mps.ohio-state.edu!usc!apple!sun-barr!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!mountn.dec.com!hkov04.dec.com!terence From: terence@hkov04.dec.com (Terence Lee @HKO, Digital Equipment Corporation) Newsgroups: comp.os.vms,comp.windows.x Subject: Re: DECW$WINMGR Weirdness Message-ID: <1722@mountn.dec.com> Date: 28 Jun 90 13:38:29 GMT Sender: news@mountn.dec.com Followup-To: comp.os.vms Organization: Digital Equipment Corporation, Hong Kong Lines: 38 In article <1376@shodha.dec.com>, west@gsrc.dec.com (Jim West (Stealth Contractor)) writes... # #In article <9518@odin.corp.sgi.com>, mikey@eukanuba.wpd.sgi.com (Mike Yang) writes... # # There is another solution. You could check for the existence of the DEC #window manager psuedo-root and then use it in your programs. What follows #is an Ada procedure that will 'look' for this window. # How about a VAXC routine? Window find_root(pwin) Window pwin; { XWindowAttributes pxwa,cxwa; Window root,parent,*child; int i,nchild; if (!XGetWindowAttributes(dpy,pwin,&pxwa)) pfail("find_root: fail to get window attributes\n"); if (XQueryTree(dpy,pwin,&root,&parent,&child,&nchild)) { for (i = 0; i < nchild; i++) { if (!XGetWindowAttributes(dpy,child[i],&cxwa)) pfail("find_root: fail to get window attributes\n"); if (pxwa.width == cxwa.width && pxwa.height == cxwa.height) return(find_root(child[i])); } return(pwin); } else pfail("find_root: fail to get root window\n"); } ================================================================================ Terence Lee terence%hkov04.dec@decwrl.dec.com root%hkvs04.dec@decwrl.dec.com From Middlesex, UWO ================================================================================