[comp.windows.x] maintaining keyed data in server?

alan@cogswell.Jpl.Nasa.Gov (Alan S. Mazer) (10/19/90)

I seem to recall that there's some way of associating arbitrary data with a
key in an X server so that multiple client processes can get the value of
some global variable.  Is this true?  The only way I can find to do this at
the moment is perhaps to use (in XView) the resources database.  Does anyone
have a general-purpose way for multiple unrelated clients (from different
machines) to get at the same data?
-- 

-- Alan			       # My aptitude test in high school suggested that
   ..!ames!elroy!alan	       # I should become a forest ranger.  Take my
   alan@elroy.jpl.nasa.gov     # opinions on computers with a grain of salt.

mouse@LARRY.MCRCIM.MCGILL.EDU (10/19/90)

> I seem to recall that there's some way of associating arbitrary data
> with a key in an X server so that multiple client processes can get
> the value of some global variable.

The simplest way to do this that comes to mind is to stuff it in a
property of the root window.  (If you want a large amount of data, you
will probably need to use other methods.)

Note also that you have to be careful to specify the correct format so
the server can byteswap the data correctly, or else put it in a
portable format yourself before putting it in the property.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

karlton@sgi.com (Phil Karlton) (10/21/90)

In article <1990Oct18.205241.24811@elroy.jpl.nasa.gov>, alan@cogswell.Jpl.Nasa.Gov (Alan S. Mazer) writes:
|> I seem to recall that there's some way of associating arbitrary data with a
|> key in an X server so that multiple client processes can get the value of
|> some global variable.

Try adding a property (say named _MAZER_DATA) and putting it on the root window of screen 0. Check out the doucmentation of XChangeProperty.

PK