Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
QWindow has inconsistent behavior in when the platform window is told about changes to the QWindow. This is an overview of the current state, for documentation purposes.
- QWindow member updated first, then QPlatformWindow setter called
- setTitle
- setFilePath
- setIcon
- setOpacity
- setVisible
- setParent
- QPlatformWindow setter called first, then QWindow member updated
- setMask
- setWindowState
- setFlags
- QPlatformWindow setter called if there's a platform window, otherwise QWindow member updated
- setGeometry
- setFramePosition
- resize
Case #1 has the advantage that the QWindow is always reflecting the current state, but also means that if the platform window wants to know the previous state it needs to store that manually.
Case #2 has the opposite siutation: the platform window can ask for window()->foo() in the setter to get the current/old state, and compare to the incoming new state. But at the same time, the platform window might accidentally apply the window() state directly, applying the old state.
Case #3 is a special case of #2, where the QWindowPrivate geometry member isn't updated until the platform comes back via QWSI into QGuiApplicationPrivate::processGeometryChangeEvent. This means we don't emit x/y/width/height change signals synchronously like we would for normal Qt properties.
Ideally we'd clean all of this up, but existing platform plugins rely on the existing semantics, so would need careful surgery