XOpenDisplay != X11Info::display()
Hi
I was trying to do some core X11 operations from Qt , but nothing works until I replaced XOpenDisplay(NULL) with X11Info::display() , then all operations worked fine.
I printed both pointers received from functions and they are not the same at all.
Code:
display=NULL;
// display=XOpenDisplay(NULL); <<-- NOT WORKING !!
printf("display=%d\n",display);
if (!display) { qDebug("unable to open local display"); return;}
window=RootWindow(display,0);
How can I use XOpenDisplay under QT?
thanx.
Re: XOpenDisplay != X11Info::display()
Qt calls XOpenDisplay() behind the scene. If you open another connection to the X server, it will be different than the one Qt opened for you. You should instead use the one Qt gives you.