From d08fba9cf9822b11695e677e4876fb59633bc0d9 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 15 Dec 2017 12:56:39 +1100 Subject: [PATCH] [host] fix cursor not visible on client reconnect --- host/Service.cpp | 9 +++------ host/Service.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/host/Service.cpp b/host/Service.cpp index d6fae2aa..c4155ccb 100644 --- a/host/Service.cpp +++ b/host/Service.cpp @@ -44,7 +44,6 @@ Service::Service() : m_frameIndex(0), m_cursorDataSize(0), m_cursorData(NULL), - m_haveShape(false), m_shapePending(false) { m_ivshmem = IVSHMEM::Get(); @@ -134,7 +133,6 @@ void Service::DeInitialize() m_timer = NULL; } - m_haveShape = false; m_shapePending = false; if (m_cursorData) @@ -271,9 +269,9 @@ bool Service::Process() if (frame.cursor.hasPos || (m_cursor.hasPos && restart)) { - if (!restart) + // remember the last state for client restart + if (frame.cursor.hasPos) { - // remember the last state for client restart m_cursor.hasPos = true; m_cursor.visible = frame.cursor.visible; m_cursor.x = frame.cursor.x; @@ -291,7 +289,7 @@ bool Service::Process() if (frame.cursor.hasShape || m_shapePending || (m_cursor.hasShape && restart)) { - if (!m_shapePending) + if (!m_shapePending && !restart) { if (frame.cursor.dataSize > m_frameSize) { @@ -315,7 +313,6 @@ bool Service::Process() } memcpy(m_cursorData, frame.cursor.shape, frame.cursor.dataSize); - m_haveShape = true; } // we can't send a frame with the cursor shape as we need the buffer location diff --git a/host/Service.h b/host/Service.h index e4bd7f73..6845b731 100644 --- a/host/Service.h +++ b/host/Service.h @@ -63,6 +63,5 @@ private: CursorInfo m_cursor; size_t m_cursorDataSize; uint8_t * m_cursorData; - bool m_haveShape; bool m_shapePending; }; \ No newline at end of file