[comp.windows.x] QueryPointer in tvtwm

wrt@steve.cray.com (William Taylor) (04/24/91)

     How do I get the pointer location when using tvtwm?

     Currently I do:
	  XQueryPointer(XtDisplay(topLevel),
        	RootWindowOfScreen(XtScreen(topLevel)),
        	&root,
        	&child,
        	&rootx, &rooty,
        	&winx, &winy,
        	&keys_buttons);

     This returns the (rootx,rooty) as absolute window numbers and not
        the location offset where the user really is in the virtual root space.

-- 
William Taylor
Cray Research, Inc.
wrt@steve.cray.com

toml@marvin.Solbourne.COM (Tom LaStrange) (04/26/91)

|>      How do I get the pointer location when using tvtwm?
|> 
|>      Currently I do:
|> 	  XQueryPointer(XtDisplay(topLevel),
|> 		RootWindowOfScreen(XtScreen(topLevel)),
|> 		&root,
|> 		&child,
|> 		&rootx, &rooty,
|> 		&winx, &winy,
|> 		&keys_buttons);
|> 
|>      This returns the (rootx,rooty) as absolute window numbers and not
|> 	the location offset where the user really is in the virtual root space.

You then need to do an XTranslateCoordinates using the virtual root window id.
See the ssetroot client or get a copy of vroot.h for examples on how to
get the virtual root window.

--
(I kid you not)Tom LaStrange        toml@Solbourne.COM