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. Xnest embedded in a QWidget
Forum Updated to NodeBB v4.3 + New Features

Xnest embedded in a QWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 2.8k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    Jupiter_80
    wrote on 28 Jun 2016, 12:08 last edited by
    #1

    I do need to display a remote Xnest terminal without close button, for this purpose I feel forced to embed this Xnest in a Qwidget without borders and as a consequence

    According to Xnest documentation, we have the option "-parent"

    -parent window_id This option tells Xnest to use window_id as the root window instead of creating a window.

    Taking into account this option I have done the following:

    ...
    windowContainer = new QWidget();
    ...
    QProcess process;
    process.setProcessChannelMode(QProcess::ForwardedChannels);
    QString program("Xnest");
    QStringList args;
    args << "-query " << ip << " -parent" << QString::number(windowContainer.winId(), 16).prepend("0x") << ":1";

    process.start(program, args);

    However, after executing Xnest I got the following error:

    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: 252
    Current serial number in output stream: 253

    This happens when I add the option "-parent".

    Please, I would appreciate if you could help me.

    Thanks in advance.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 28 Jun 2016, 15:24 last edited by
      #2

      Hi and welcome
      Have you tried with other window to verify -parent does work?
      Maybe try to use xprop to see the ID directly ?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jupiter_80
        wrote on 29 Jun 2016, 06:05 last edited by
        #3

        Yes, I tried with another window to discard WindowId was wrong, but it failed again.

        M 1 Reply Last reply 29 Jun 2016, 06:32
        0
        • J Jupiter_80
          29 Jun 2016, 06:05

          Yes, I tried with another window to discard WindowId was wrong, but it failed again.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 29 Jun 2016, 06:32 last edited by
          #4

          @Jupiter_80
          It also failed with other non Qt window?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jupiter_80
            wrote on 30 Jun 2016, 06:24 last edited by
            #5

            The problem appears when I try to run Xnest as a child.

            bash$ display /home/user/images/example.png &

            bash$ xwininfo |grep id:
            -> parent window ID

            bash$ Xnest -parent 0x2000011 :1

            Produced error message:

            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: 69
            Current serial number in output stream: 70

            M 1 Reply Last reply 30 Jun 2016, 06:29
            0
            • J Jupiter_80
              30 Jun 2016, 06:24

              The problem appears when I try to run Xnest as a child.

              bash$ display /home/user/images/example.png &

              bash$ xwininfo |grep id:
              -> parent window ID

              bash$ Xnest -parent 0x2000011 :1

              Produced error message:

              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: 69
              Current serial number in output stream: 70

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 30 Jun 2016, 06:29 last edited by
              #6

              @Jupiter_80
              Hi
              Yes, I also tried with both Qt and non Qt windows.
              I cannot get -parent to work at all.

              Did you have it work with any non Qt window?

              1 Reply Last reply
              1
              • J Offline
                J Offline
                Jupiter_80
                wrote on 6 Jul 2016, 07:29 last edited by
                #7

                Unfortunatelly, it does not work even with a Non Qt Window.

                M 1 Reply Last reply 6 Jul 2016, 07:53
                0
                • J Jupiter_80
                  6 Jul 2016, 07:29

                  Unfortunatelly, it does not work even with a Non Qt Window.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 6 Jul 2016, 07:53 last edited by
                  #8

                  @Jupiter_80
                  Hi, i didn't have any luck either. (with Xnest)
                  I wonder if
                  http://manpages.ubuntu.com/manpages/wily/man1/Xephyr.1.html
                  might be an option?

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jupiter_80
                    wrote on 8 Jul 2016, 10:59 last edited by
                    #9

                    Thanks but it is mandatory to use Xnest in our system ....

                    1 Reply Last reply
                    0

                    1/9

                    28 Jun 2016, 12:08

                    • Login

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