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

[Reg 5.15.8->5.15.10?/6.x][XCB plugin] QWidget::winId() can return invalid xcb_drawable_t values

    XMLWordPrintable

Details

    • Linux/X11

    Description

      winId(), effectiveWinId(), and internalWinId() are all affected.

       

      Steps to reproduce

      1. Build and run the attached project on Linux (it is a modified version of https://doc.qt.io/qt-6/qtwidgets-widgets-windowflags-example.html where the ControllerWindow calls xcb_get_geometry_reply() to test the winId() whenever updating the PreviewWindow)
      1. Select different window "Type"s, and toggle the different "Hints"

       

      Outcomes

      • On Qt 5.15.8, the winId()s are always OK
      • On newer versions of Qt, selecting Qt::WindowType::Tooltip, enabling/disabling Qt::WindowType::WindowStaysOnBottomHint, or enabling/disabling Qt::WindowType::WindowStaysOnTopHint will produce an invalid winId(). This impacts the customer's ability to call the XCB API directly on their windows.

       

      Partial workaround
      Always set all flags before show()-ing a widget for the first time - this seems to avoid the problem. (However, this doesn't help with changing the window flags on an existing window)

      Attachments

        Issue Links

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

          Activity

            People

              liaqi Liang Qi
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes