The syncing of the window geometry to the internal geometry can
unfortunately cause a freeze in very special conditions:
- create QML component
- a Plasma::Dialog gets created
- It creates the DialogShadows
- This triggers QGlobalStatic creation which locks a non-recursive
mutex
- The creation of DialogShadows creates a Registry and triggers a
roundtrip on the Wayland server
- KWin processes all Wayland events
- This triggers the creation of a ShellClient
- The ShellClient has a PlasmaShellSurface which requested a position
- The new geometry does not match the geometry of the Plasma::Dialog
- ShellClient syncs the geometry to the Plasma::Dialog
- Plasma::Dialog updates the theme because window geometry changed
- This accesses the DialogShadows...
which is still in the non recursive mutex and we have a freeze.
By delaying the sync to the end of cycle we jump out of this deadly
sequence.
BUG: 384441