Set Toplevel::m_surface to nullptr if SurfaceInterface gets destroyed
When minimizing an Xwayland client the Xwayland server destroys the Surface causing our next access to the Surface to crash KWin. So for safety we connect to the destroyed signal and reset the pointer. The disadvantage is that a minimized Xwayland window doesn't have a preview any more.
This commit is contained in:
parent
5a98d8bbbd
commit
1e16ab2567
1 changed files with 5 additions and 0 deletions
|
@ -458,6 +458,11 @@ void Toplevel::setSurface(KWayland::Server::SurfaceInterface *surface)
|
|||
}
|
||||
m_surface = surface;
|
||||
connect(m_surface, &SurfaceInterface::damaged, this, &Toplevel::addDamage);
|
||||
connect(m_surface, &SurfaceInterface::destroyed, this,
|
||||
[this] {
|
||||
m_surface = nullptr;
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue