mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[client/idd] input: wait for valid keyboard LED feedback
Do not publish the default all-off LED value until Windows supplies a real HID output report. Treat the first all-off report as valid and retain known state across pipe reconnects. Serialize feedback processing with connection invalidation so a stale message cannot restore validity after disconnect.
This commit is contained in:
@@ -636,6 +636,11 @@ bool CInputPipeServer::OnPipeMessage(
|
||||
|
||||
const LGInputPipeMessage& frame =
|
||||
*static_cast<const LGInputPipeMessage *>(message);
|
||||
|
||||
CSRWExclusiveLock connectionLock(m_connectionLock);
|
||||
if (!(Atomic::Load(m_state, std::memory_order_relaxed) & 1))
|
||||
return true;
|
||||
|
||||
if (frame.magic != LG_INPUT_PIPE_MAGIC ||
|
||||
frame.version != LG_INPUT_PIPE_VERSION ||
|
||||
frame.type != LG_INPUT_PIPE_MESSAGE_KEYBOARD_LEDS ||
|
||||
|
||||
Reference in New Issue
Block a user