Why I can't get X Display handle?
I call XOpenDisplay to connect to the X server but get a NULL pointer. My client program run in the text terminal, not GUI desktop. I have got the MIT key using the xauth and set the enviroment variable DISPLAY to "localhost/unix:0". My linux distribution is openSUSE 11.1.
I have test our program on Ubuntu, Debian and SLE10-sp2, it's ok. So I am confused. :confused: |
We are all confused, as you havent asked any questions, nore provided any real information. There could be a number of issues, so Ill just list a checklist.
* Does your program work under normal X? (run the program in a xterm or such under a user thats running and using X) * Can other X programs run under your test conditions? (see if its only your program that has a problem) * Are you using passing a custom string to XOpenDisplay or are using the normal NULL? * Try other DISPLAYs, such as ':0' or ':0.0' |
Quote:
>>* Does your program work under normal X? (run the program in a xterm or such under a user thats running and using X) Yes. All is OK under the GUI desktop enviroment. There is the connection problem under the normal character terminal. >>* Can other X programs run under your test conditions? (see if its only your program that has a problem) No. I wrote the program just to test if it's OK to connect to the X server so it's very simple, which just call XOpenDisplay and XCloseDisplay. >>* Are you using passing a custom string to XOpenDisplay or are using the normal NULL? >>* Try other DISPLAYs, such as ':0' or ':0.0' I have tried :0.0, :0, but return error: No protocol specified I have tried NULL, localhost/unix:0, localhost:0, localhost/unix:0.0, localhost:0.0, but get NULL Display pointer. |
If the program works under X, then open a xterm and check the DISPLAY ("env | grep DISPLAY"), then set it your terminal according to that.
By any chance did the out was anything useful? If its a permissions error, the output should have something like "connection refused" or somesuch. |
Quote:
|
Quote:
I wonder why there is the problem under openSUSE 11.1. |
All times are GMT -5. The time now is 11:34 PM. |