Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.15, 6.2.10, 6.5.3, 6.6.0
Description
winId(), effectiveWinId(), and internalWinId() are all affected.
Steps to reproduce
- 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)
- 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
- duplicates
-
QTBUG-106033 Setting Qt::WindowStaysOnTopHint/Qt::WindowStaysOnBottomHint breaks winId
- Open