[scene] Fix segfault in KWin::WindowPixmap::shape
From scene.h
:-
/** * @returns the surface this WindowPixmap references, might be @c null. */ KWaylandServer::SurfaceInterface *surface() const;
There is a situation where subSurface()
can return a non-null value, but surface()
returns null. This MR just checks that surface()
is defined before using it avoiding a segfault.
Reproducer:
- Open Konsole (probably works with any window)
- Right click the decoration and select "Configure Special Window Settings..."
- Close the window specific settings dialog
- kwin_wayland crashes.
Edited by Lewis Lakerink