[comp.windows.x] XGetDefaults in X11 R4

dl2n+@ANDREW.CMU.EDU (Daniel Edward Lovinger) (09/30/89)

Problem :

	I am involved in writing a large server based application for
X that tries (operative word) to use XGetDefaults for various basic
settings. A typical run involves 8-12 seperate displays being run off
of a central server. However, when a call to XGetDefaults is made, the
following scenario often ensues :

	Remote display does not have an initialized default structure
		for whatever reason (user not using defaults).
	
	XGetDefaults() discovers this inside of InitDefaults() and loads
		in the .Xdefaults OF THE PERSON RUNNING THE SERVER.

	Needless to say, this isn't exactly expected behavior (nor
desired ;-) especially when the defaults are supposed to be unique
across the displays.

Questions :

	Will this behavior still be present in R4?

	For the time being, is there any clean way to avoid this
		problem, ignore .Xdefaults and only pay aattention 
		to the loaded defaults? I am planning on releasing 
		this into the contrib section of the R4 tape and 
		can't include R3 core header files in the 
		distribution.

	If still present in R4, is there an alternative way of
		checking defaults that doesn't try to get them
		from the .Xdefaults?

	Helf!

--------------
dl2n+@andrew.cmu.edu			dan lovinger
...!harvard!andrew.cmu.edu!dl2n+	dept of physics

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (10/02/89)

	XGetDefaults() discovers this inside of InitDefaults() and loads
		in the .Xdefaults OF THE PERSON RUNNING THE SERVER.

Correct.  This is the expected (specified) and desirable behavior.

	Will this behavior still be present in R4?

Yes.

	is there any clean way to avoid this
	problem, ignore .Xdefaults and only pay aattention 
	to the loaded defaults?

See below.  (Alternatively, putenv() HOME to somewhere random?)

	is there an alternative way of
	checking defaults that doesn't try to get them
	from the .Xdefaults?

XGetDefaults is just a convenience interface to a particular resource database.
If you don't like the way it's set up, create your own (directly from the
RESOURCE_MANAGER property of the display) and use XrmGetResource directly.