Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Embed Xnest in QX11EmbedContainer
QtWS25 Last Chance

Embed Xnest in QX11EmbedContainer

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    surlykke
    wrote on last edited by
    #1

    Hi list

    I wanted to run the X-server Xnest inside a Qt widget, so I adapted the example from QX11EmbedContainer as follows:

    @
    #include <QApplication>
    #include <QProcess>
    #include <QDebug>
    #include <QX11EmbedContainer>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    QX11EmbedContainer container;
    container.show();
    
    QProcess process;
    process.setProcessChannelMode(QProcess::ForwardedChannels);
    
    QString program("Xnest");
    QStringList args;
    args << "-parent" << QString::number(container.winId(), 16).prepend("0x")  << ":1";
    
    process.start(program, args);
    
    return a.exec&#40;&#41;;
    

    }
    @

    When I run it I get:

    @
    [dix] Could not init font path element /usr/share/fonts/OTF/, removing from list!
    xnest warning: unhandled event
    xnest warning: unhandled event
    xnest warning: unhandled event
    X Error of failed request: BadAccess (attempt to access private resource denied)
    Major opcode of failed request: 2 (X_ChangeWindowAttributes)
    Serial number of failed request: 135
    Current serial number in output stream: 137
    @

    There is a brief flicker where it looks like Xnest has embedded itself in the QX11EmbedContainer and the title of the widget is changed to Xnest, but Xnest itself exits.

    If i run an instance of xterm I am able to embed Xnest in that xterm-instance with the command:

    @Xnest -parent <windowid-of-xterm-instance> :1@

    Hours of googling has not come up with anything.

    Does anybody know what the problem is? Has anybody ever run Xnest embedded in a Qt widget?

    best regards
    Christian Surlykke

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved