Move code on wayland surface being created.

Authored by davidedmundson on May 11 2017, 10:16 AM.

Description

Move code on wayland surface being created.

Summary:
We need to setup our attachments when the wl_surface is created.
This gets recreated when a window is hidden and shown.

QPlatformSurfaceCreated is emitted once, when the backing store is created,
not when the wl_surface is created, despite it's similar sounding name.

QEvent::Show is too soon, as this is before the platform gets setVisible
We do however, always get an expose event. QEvent::Hide weirdly comes after
the platform has done its thing.

Expose is called whilst we are in QWaylandWindow::setVisible, so before the initial surface has been committed, so we still have perfect frames.

Test Plan:
See attached test
Still has window decos after hide/show

Ran on Qt 5.9 and Qt 5.7

Reviewers: Plasma, graesslin

Reviewed By: Plasma, graesslin

Subscribers: graesslin, plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D5746

Details