Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61140

Foreign XCB QWindows get destroyed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.9.0
    • QPA: X11/XCB
    • None

    Description

      QWindows created by QWindow::fromWinId get destroyed with xcb_destroy_window, which is not expected. For instance, it breaks setting a transient parent of a window to a foreign window if the forein window gets deleted during cleanup.

      See also https://bugs.kde.org/show_bug.cgi?id=380392

      Minimal reproducer, launch with winId of target window as argument.

      #include <QApplication>
      #include <QWindow>
      
      int main(int argc, char *argv[])
      {
              QApplication app(argc, argv);
              delete QWindow::fromWinId(strtol(argv[1], nullptr, 0));
      }
      

      With Qt < 5.9.0, nothing happens. With Qt 5.9.0 however, the target window disappears.
      With a breakpoint on xcb_destroy_window I can confirm that it's called with 5.9.0 but not with earlier versions.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            vogtinator Fabian Vogt
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes