From 82e10c1b7e756ed02093ecfe699bc46daa77defa Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 4 Jul 2021 19:45:10 +1000 Subject: [PATCH] [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. --- host/src/app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/src/app.c b/host/src/app.c index 9825e90b..77464ea7 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -397,8 +397,8 @@ static void sendPointer(bool newClient) app.pointerShape = mem; } - // only advance the index if the shape was changed - if ((flags & CURSOR_FLAG_SHAPE) != 0) + // only advance if the pointer shape was not swapped out of the list + if ((flags & CURSOR_FLAG_SHAPE) == 0) if (++app.pointerIndex == POINTER_SHAPE_BUFFERS) app.pointerIndex = 0;