Adapt window recreation to wl_surface as winId and lifetime changes


Returning wl_surface as winId broke widget windows after reconnect.
When fetching globals from the new connection new screens are added,
this results in QWidget being notified of a screen change. It then
refreshes its cached winId which at this point in time will be 0
since the window does not have a new window yet. Then when a widget
repainting the backing store will never be flushed because it doesnt
find a native parent anymore by going up the parent chain and looking
for a widget with non-null winId.
Fix this by recreating the wl_surface after fetching the globals
but before the initital roundtrip.
While at it dont recreate role objects for windows that dont need
them. With the changes that also now hidden windows have wl_surfaces
we would recreate them along with closed popups.

Change-Id: Ib7ed27d1f25df84c85cce4802726178586c19d55
Reviewed-by: David Edmundson <davidedmundson@kde.org>
commit97caf07e72a82a2b35a17aa7debcfc22ca9b903c
parent1f73059ec58b1e9ab137b701607b59cfa77750c9
authorDavid Redondo <qt@david-redondo.de>
committerDavid Redondo <qt@david-redondo.de>
commit timeWed, 13 Nov 2024 08:41:58 +0100