[host] fix cursor not visible on client reconnect

This commit is contained in:
Geoffrey McRae 2017-12-15 12:56:39 +11:00
parent df13340439
commit d08fba9cf9
2 changed files with 3 additions and 7 deletions

View File

@ -44,7 +44,6 @@ Service::Service() :
m_frameIndex(0), m_frameIndex(0),
m_cursorDataSize(0), m_cursorDataSize(0),
m_cursorData(NULL), m_cursorData(NULL),
m_haveShape(false),
m_shapePending(false) m_shapePending(false)
{ {
m_ivshmem = IVSHMEM::Get(); m_ivshmem = IVSHMEM::Get();
@ -134,7 +133,6 @@ void Service::DeInitialize()
m_timer = NULL; m_timer = NULL;
} }
m_haveShape = false;
m_shapePending = false; m_shapePending = false;
if (m_cursorData) if (m_cursorData)
@ -270,10 +268,10 @@ bool Service::Process()
} }
if (frame.cursor.hasPos || (m_cursor.hasPos && restart)) if (frame.cursor.hasPos || (m_cursor.hasPos && restart))
{
if (!restart)
{ {
// remember the last state for client restart // remember the last state for client restart
if (frame.cursor.hasPos)
{
m_cursor.hasPos = true; m_cursor.hasPos = true;
m_cursor.visible = frame.cursor.visible; m_cursor.visible = frame.cursor.visible;
m_cursor.x = frame.cursor.x; m_cursor.x = frame.cursor.x;
@ -291,7 +289,7 @@ bool Service::Process()
if (frame.cursor.hasShape || m_shapePending || (m_cursor.hasShape && restart)) if (frame.cursor.hasShape || m_shapePending || (m_cursor.hasShape && restart))
{ {
if (!m_shapePending) if (!m_shapePending && !restart)
{ {
if (frame.cursor.dataSize > m_frameSize) if (frame.cursor.dataSize > m_frameSize)
{ {
@ -315,7 +313,6 @@ bool Service::Process()
} }
memcpy(m_cursorData, frame.cursor.shape, frame.cursor.dataSize); 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 // we can't send a frame with the cursor shape as we need the buffer location

View File

@ -63,6 +63,5 @@ private:
CursorInfo m_cursor; CursorInfo m_cursor;
size_t m_cursorDataSize; size_t m_cursorDataSize;
uint8_t * m_cursorData; uint8_t * m_cursorData;
bool m_haveShape;
bool m_shapePending; bool m_shapePending;
}; };