[server] Only send surface leave if resources are still valid
If a resource is null, because e.g. the surface got already destroyed, wayland will create an error while marshalling arguments causing the connected client to in worst case abort.
This commit is contained in:
parent
ed080780fd
commit
35a854e991
2 changed files with 6 additions and 2 deletions
|
@ -118,7 +118,9 @@ void KeyboardInterface::setFocusedSurface(SurfaceInterface *surface, quint32 ser
|
|||
{
|
||||
Q_D();
|
||||
if (d->focusedSurface) {
|
||||
if (d->resource && d->focusedSurface->resource()) {
|
||||
wl_keyboard_send_leave(d->resource, serial, d->focusedSurface->resource());
|
||||
}
|
||||
disconnect(d->destroyConnection);
|
||||
}
|
||||
d->focusedSurface = surface;
|
||||
|
|
|
@ -116,7 +116,9 @@ void PointerInterface::setFocusedSurface(SurfaceInterface *surface, quint32 seri
|
|||
Q_D();
|
||||
Q_ASSERT(d->resource);
|
||||
if (d->focusedSurface) {
|
||||
if (d->resource && d->focusedSurface->resource()) {
|
||||
wl_pointer_send_leave(d->resource, serial, d->focusedSurface->resource());
|
||||
}
|
||||
disconnect(d->destroyConnection);
|
||||
}
|
||||
if (!surface) {
|
||||
|
|
Loading…
Reference in a new issue