[comp.windows.x] tvtwm and xwd compatibility

woan@nowhere (Ronald S Woan) (02/15/91)

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...



--
+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan       woan@peyote.cactus.org or woan%austin@iinus1.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

toml@marvin.Solbourne.COM (Tom LaStrange) (02/15/91)

> 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...

Not yet.  For now, make the window sticky (f.stick) before doing the xwd

--
Tom LaStrange        toml@Solbourne.COM

chn@lanl.gov (Charles Neil) (02/15/91)

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...

I use xsnap -xwd under tvtwm to obtain an xwd of a rubber-banded region 
of the screen.  The source is on expo.lcs.mit.edu (among other places).
-- 

	-Charlie Neil (chn@lanl.gov)
	 Los Alamos National Laboratory (505) 665-0978

winslett@widor.cs.unc.edu (Michael Winslett) (02/16/91)

> 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?

- Michael
-------------------------------------------------------------------------------
Michael E. Winslett		University of North Carolina at Chapel Hill
winslett@cs.unc.edu		Department of Computer Science
(919) 962-1710			Sitterson Hall #121

dce@smsc.sony.com (David Elliott) (02/22/91)

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 <X11/Xatom.h>
+ 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 <X11/Xatom.h>
+ 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..."