Make use of QWaylandWindow::surfaceRoleCreated for setMainWindow
New in Qt 6.8: It's emitted when the XDG Surface is assigned a role (e.g. XDG Toplevel) which lets us more precisely set up the XDG Foreign relationship and ensures the window doesn't briefly flash in Task Manager as not transient.
While at it, make doSetMainWindow static since it doesn't access this
and avoids capturing it into the connection whose only context
is (wayland)Window.
Verified with plasma/plasma-workspace!3733 (merged) that it no longer flashes in task bar briefly as it opens
Edited by Kai Uwe Broulik