From 9759b5aa8f67a1d0b44ad6871487c96c4dc33c91 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 14 Apr 2023 21:40:21 +1000 Subject: [PATCH] [idd] the cursor pos is only valid if it's visible --- idd/LGIdd/CIndirectDeviceContext.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/idd/LGIdd/CIndirectDeviceContext.cpp b/idd/LGIdd/CIndirectDeviceContext.cpp index c3019156..7409bfba 100644 --- a/idd/LGIdd/CIndirectDeviceContext.cpp +++ b/idd/LGIdd/CIndirectDeviceContext.cpp @@ -466,16 +466,18 @@ void CIndirectDeviceContext::SendCursor(const IDARG_OUT_QUERY_HWCURSOR& info, co } KVMFRCursor * cursor = (KVMFRCursor *)lgmpHostMemPtr(mem); - + m_cursorVisible = info.IsCursorVisible; - m_cursorX = info.X; - m_cursorY = info.Y; + uint32_t flags = 0; - cursor->x = (int16_t)info.X; - cursor->y = (int16_t)info.Y; - - uint32_t flags = CURSOR_FLAG_POSITION | - (info.IsCursorVisible ? CURSOR_FLAG_VISIBLE : 0); + if (info.IsCursorVisible) + { + m_cursorX = info.X; + m_cursorY = info.Y; + cursor->x = (int16_t)info.X; + cursor->y = (int16_t)info.Y; + flags |= CURSOR_FLAG_POSITION | CURSOR_FLAG_VISIBLE; + } if (info.CursorShapeInfo.CursorType != IDDCX_CURSOR_SHAPE_TYPE_UNINITIALIZED) {