[channels,rdpei] fix pen contact

This commit is contained in:
ichaoX 2023-09-10 21:09:54 +08:00 committed by akallabeth
parent 48a55aa95b
commit a6e9cfa6d9

View File

@ -1195,17 +1195,13 @@ static UINT rdpei_pen_process(RdpeiClientContext* context, INT32 externalId, UIN
rdpei = (RDPEI_PLUGIN*)context->handle; rdpei = (RDPEI_PLUGIN*)context->handle;
const BOOL active = (contactFlags & RDPINPUT_CONTACT_FLAG_DOWN) == 0;
EnterCriticalSection(&rdpei->lock); EnterCriticalSection(&rdpei->lock);
/* If a normal down event is given, we start a new contact. // Start a new contact only when it is not active.
* If that fails, check if we have a new hover event */ contactPoint = rdpei_pen_contact(rdpei, externalId, TRUE);
contactPoint = rdpei_pen_contact(rdpei, externalId, active);
if (!contactPoint) if (!contactPoint)
{ {
const UINT32 mask = RDPINPUT_CONTACT_FLAG_INRANGE | RDPINPUT_CONTACT_FLAG_UPDATE; const UINT32 mask = RDPINPUT_CONTACT_FLAG_INRANGE;
const UINT32 negmask = if ((contactFlags & mask) == mask)
RDPINPUT_CONTACT_FLAG_DOWN | RDPINPUT_CONTACT_FLAG_INCONTACT | RDPINPUT_CONTACT_FLAG_UP;
if (((contactFlags & mask) == mask) && ((contactFlags & negmask) == 0))
{ {
contactPoint = rdpei_pen_contact(rdpei, externalId, FALSE); contactPoint = rdpei_pen_contact(rdpei, externalId, FALSE);
} }