Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.windows.x Subject: Re: tvtwm and xwd compatibility Keywords: tvtwm xwd X Message-ID: <1991Feb21.173109.22941@smsc.sony.com> Date: 21 Feb 91 17:31:09 GMT References: <3510@d75.UUCP> <14808@lanl.gov> <1601@borg.cs.unc.edu> Sender: dce@smsc.sony.com (David Elliott) Reply-To: dce@smsc.sony.com (David Elliott) Organization: Sony Microsystems, San Jose, CA Lines: 159 In article <1601@borg.cs.unc.edu>, winslett@widor.cs.unc.edu (Michael Winslett) writes: |> |> > In article <3510@d75.UUCP>, woan@nowhere (Ronald S Woan) writes: |> > > So, is there a version of xwd compatible with the tvtwm window |> > > manager. The X11R4 distrubted version seems to give a picture of my |> > > icon manager no matter which window I try to dump... |> |> This sounds similar to the problem I have with xwininfo under tvtwm |> (DECstation 3100, X11R4). xwininfo always gives info about the same |> window, regardless of which window I click the mouse in. Anyone have |> a fix for this? As posted before, here are the fixes to xprop and xwininfo. These are not official patches, and the X Consortium has not made any moves I know of towards adopting the tvtwm/swm-style virtual root mechanism. *** /tmp/,RCSt1a000wJ Thu Nov 1 08:36:14 1990 --- clients/xprop/dsimple.c Thu Nov 1 08:34:29 1990 *************** *** 386,392 **** --- 386,430 ---- outl("blip!"); } + /* Function Name: GetVRoot + * Description: Gets the root window, even if it's a virtual root + * Arguments: the display and the screen + * Returns: the root window for the client + */ + #include + Window + GetVRoot(dpy, scr) + Display *dpy; + int scr; + { + + Window rootReturn, parentReturn, *children; + unsigned int numChildren; + Window root = RootWindow(dpy,scr); + Atom __SWM_VROOT = None; + int i; + + __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False); + XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren); + for (i = 0; i < numChildren; i++) + { + Atom actual_type; + int actual_format; + long nitems, bytesafter; + Window *newRoot = NULL; + + if (XGetWindowProperty (dpy, children[i], __SWM_VROOT,0,1, + False, XA_WINDOW, &actual_type, &actual_format, &nitems, + &bytesafter, (unsigned char **) &newRoot) == Success && newRoot) { + root = *newRoot; + break; + } + } + + return root; + } + /* * Routine to let user select a window using the mouse */ *************** *** 397,403 **** int status; Cursor cursor; XEvent event; ! Window target_win = None, root = RootWindow(dpy,screen); int buttons = 0; /* Make the target cursor */ --- 435,441 ---- int status; Cursor cursor; XEvent event; ! Window target_win = None, root = GetVRoot(dpy, screen); int buttons = 0; /* Make the target cursor */ *** /tmp/,RCSt1a000wJ Thu Nov 1 08:36:14 1990 --- clients/xwininfo/dsimple.c Thu Nov 1 08:34:29 1990 *************** *** 386,392 **** --- 386,430 ---- outl("blip!"); } + /* Function Name: GetVRoot + * Description: Gets the root window, even if it's a virtual root + * Arguments: the display and the screen + * Returns: the root window for the client + */ + #include + Window + GetVRoot(dpy, scr) + Display *dpy; + int scr; + { + + Window rootReturn, parentReturn, *children; + unsigned int numChildren; + Window root = RootWindow(dpy,scr); + Atom __SWM_VROOT = None; + int i; + + __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False); + XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren); + for (i = 0; i < numChildren; i++) + { + Atom actual_type; + int actual_format; + long nitems, bytesafter; + Window *newRoot = NULL; + + if (XGetWindowProperty (dpy, children[i], __SWM_VROOT,0,1, + False, XA_WINDOW, &actual_type, &actual_format, &nitems, + &bytesafter, (unsigned char **) &newRoot) == Success && newRoot) { + root = *newRoot; + break; + } + } + + return root; + } + /* * Routine to let user select a window using the mouse */ *************** *** 397,403 **** int status; Cursor cursor; XEvent event; ! Window target_win = None, root = RootWindow(dpy,screen); int buttons = 0; /* Make the target cursor */ --- 435,441 ---- int status; Cursor cursor; XEvent event; ! Window target_win = None, root = GetVRoot(dpy, screen); int buttons = 0; /* Make the target cursor */ -- ...David Elliott ...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce ...(408)944-4073 ..."His lower lip waved poutily with defiance..."