Handle restart of Compositor Scene correctly for Wayland client
Summary:
This change ensures that KWin doesn't crash in the QPainter scene if
the compositor gets restarted and if there are Wayland clients.
Cherry-picked from master
BUG: 365471
FIXED-IN: 5.7.3
Test Plan:
Test case added to scene qpainter which triggers a restart
of the Compositor with a window being shown. Verifies that rendering
is correct afterwards.
Reviewers: KWin, Plasma on Wayland
Subscribers: plasma-devel, kwin
Tags: Plasma on Wayland, KWin
Differential Revision: https://phabricator.kde.org/D2185