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>