答复: A question about XOpenDisplay fail

Alan Coopersmith alan.coopersmith at oracle.com
Wed Apr 28 07:28:10 PDT 2010


Ma, Qingyu (GE Healthcare) wrote:
> Thanks for your reply.
> 
> My process is executed in a script which is executed by another process. The script is like:
> 
> export DISPLAY=:0.1
> ./myProcess & 
> export  DISPLAY=:0.0
> 
> I know when myProcess opens display, current DISPLAY maybe changed back to :0.0.  It's another issue. But till now, myProcess is displayed on :0.1 each time.
> Of course, I'm not sure if myProcess try to open display at the right point of changing DISPLAY, whether it can get a valid display (0 or 1)?

export/setenv only affect processes started from the shell after the command is
run.   Since myProcess is already running, the second export cannot affect it.

> Is there any other possibility to cause XOpenDisplay fail, like network, IP stack or anything?

XOpenDisplay can also fail if:

 - you don't have currently valid authorization (either a good
   entry in the xauthority file for the display or a xhost entry
   allowing access to your host/userid - see the XSecurity man
   page for more info on the various authentication mechanisms)

 - DISPLAY specifies an invalid hostname

 - the X server is not running

 - the X server has hit it's maximum number of open connections,
   such as if you called XOpenDisplay() every time you wanted to
   change an LED, and never called XCloseDisplay()

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System




More information about the xorg mailing list