Results 1 to 2 of 2

Thread: XOpenDisplay != X11Info::display()

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    1

    Default 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.

    Qt Code:
    1. display=NULL;
    2. // display=XOpenDisplay(NULL); <<-- NOT WORKING !!
    3. display=QX11Info::display();
    4. printf("display=%d\n",display);
    5. if (!display) { qDebug("unable to open local display"); return;}
    6. window=RootWindow(display,0);
    To copy to clipboard, switch view to plain text mode 

    How can I use XOpenDisplay under QT?

    thanx.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  3. The following user says thank you to wysota for this useful post:

    hasanen (16th April 2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.