Cache clientConnection in SurfaceInterface
Order of a client teardown is:
- ClientConnection is removed from the static map
- All our client owned resources are torn down
- ClientConnection is deleted (via a previous deleteLater)
The recent refactor led to a behavioural change where ::client could return a null pointer.
We want the client getter to be valid throughout the lifespan of SurfaceInterface, by doing the lookup once we achieve that.
Completely untested, based on the backtrace
Alternative to kwin!120 (closed) To a large extent I'm happy with either, but I thought a behavioural change of kwayland-server might mean we get this same bug popping up in other obscure places.