Fix crash trying to update seat cursor outputs

* seat.c (UpdateCursorOutput): Do not update if the surface has
been destroyed.
This commit is contained in:
hujianwei 2022-11-17 06:18:50 +00:00
parent 01a957737b
commit 1b02ff9833

5
seat.c
View file

@ -885,6 +885,11 @@ UpdateCursorOutput (SeatCursor *cursor, int root_x, int root_y)
{
int hotspot_x, hotspot_y;
if (!cursor->role.surface)
/* The surface has been destroyed, so there is no point in
continuing. */
return;
/* Scale the hotspot coordinates up by the scale factor specified in
the surface. */
hotspot_x = cursor->hotspot_x * cursor->role.surface->factor;