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.icc-effect-5.14.5
parent
5a98d8bbbd
commit
1e16ab2567
|
@ -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 New Issue