[InputRedirection] Don't crash on invalid Toplevel

Reviewed-By: Martin Gräßlin
This commit is contained in:
Bhushan Shah 2015-11-16 20:57:23 +05:30
parent 38f19dafb2
commit 42ddf685c1

View file

@ -704,10 +704,12 @@ void InputRedirection::processPointerMotion(const QPointF &pos, uint32_t time)
if (waylandServer()->isScreenLocked()) {
Toplevel *t = findToplevel(pos.toPoint());
if (auto seat = findSeat()) {
seat->setFocusedPointerSurface(t->surface(), t->pos());
seat->setTimestamp(time);
seat->setPointerPos(pos);
if (t && t->surface()) {
if (auto seat = findSeat()) {
seat->setFocusedPointerSurface(t->surface(), t->pos());
seat->setTimestamp(time);
seat->setPointerPos(pos);
}
}
return;
}