Re: [Nautilus-list] Activation problems



Hi Havoc,

On Fri, 2002-03-08 at 19:47, Havoc Pennington wrote:
> I don't know if it's relevant but I told Maciej the secret way to get
> the canonical name of a display - getenv("DISPLAY") should never be
> used here.

	Well we all agree that that is the case ;-) there were some 'fun' hacks
to ensure that the environment variable was set to the right thing
before oaf was initialized that have mercifully gone.

> You want DisplayString(display) which is canonicalized; 
> XDisplayName() is the same as the getenv. gdk_get_display() returns
> the one that you do NOT want, as it uses XDisplayName().

	Gack, the man page is less than totally clear on this:

	"The DisplayString macro returns the string that was passed to
	 XOpenDisplay when the current display was opened."

vs.

       "The XDisplayName function returns the name of the display that
	XOpenDisplay would attempt to use.  If a NULL string is
	specified, XDisplayName looks in the environment for the display
	and returns the display name that XOpenDisplay would attempt to
	use.  This makes it easier to report to the user precisely which
	display the program attempted to open when the initial
	connection attempt failed."

	The fix works then because we do the display work consistently, we just
don't use the right string ;-)

> I'm not sure if this should be fixed in GDK or not, cc'ing Owen.

	It would be nice not to have to use an X call directly (clearly) but
...

> You _do_ want XDisplayName()/getenv for reporting error messages to
> the user like "can't open display foo", though.

	Yes, thanks for pointing that out,

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]