[host] app: fix inverted cursor shape logic

We should only advance the pointerIndex if the buffer was not swapped
out for storage. This is to ensure that we do not overwrite cursor
memory that the client(s) may still be using.
This commit is contained in:
Geoffrey McRae 2021-07-04 19:45:10 +10:00
parent cd10e02862
commit 82e10c1b7e

View File

@ -397,8 +397,8 @@ static void sendPointer(bool newClient)
app.pointerShape = mem; app.pointerShape = mem;
} }
// only advance the index if the shape was changed // only advance if the pointer shape was not swapped out of the list
if ((flags & CURSOR_FLAG_SHAPE) != 0) if ((flags & CURSOR_FLAG_SHAPE) == 0)
if (++app.pointerIndex == POINTER_SHAPE_BUFFERS) if (++app.pointerIndex == POINTER_SHAPE_BUFFERS)
app.pointerIndex = 0; app.pointerIndex = 0;