From 6fab23fb949028d88adab975cf05d5b549642868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= <8659494+mhaeuser@users.noreply.github.com> Date: Sun, 7 Mar 2021 15:10:41 +0100 Subject: [PATCH] OpenCanopy: Do not delegate past pointer events --- Platform/OpenCanopy/OpenCanopy.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Platform/OpenCanopy/OpenCanopy.c b/Platform/OpenCanopy/OpenCanopy.c index b7311ea1..9f834be4 100644 --- a/Platform/OpenCanopy/OpenCanopy.c +++ b/Platform/OpenCanopy/OpenCanopy.c @@ -976,6 +976,7 @@ GuiDrawLoop ( UINT64 LoopStartTsc; UINT64 LastTsc; UINT64 NewLastTsc; + BOOLEAN ObjectHeld; CONST GUI_IMAGE *CursorImage; @@ -983,6 +984,7 @@ GuiDrawLoop ( mNumValidDrawReqs = 0; HoldObject = NULL; + ObjectHeld = FALSE; // // Clear previous inputs. @@ -1024,17 +1026,24 @@ GuiDrawLoop ( // GuiPointerGetState (mPointerContext, &PointerState); - if (PointerState.PrimaryDown && HoldObject == NULL) { - HoldObject = GuiObjDelegatePtrEvent ( - DrawContext->Screen, - DrawContext, - DrawContext->GuiContext, - GuiPointerPrimaryDown, - 0, - 0, - PointerState.X, - PointerState.Y - ); + if (PointerState.PrimaryDown) { + if (!ObjectHeld && HoldObject == NULL) { + HoldObject = GuiObjDelegatePtrEvent ( + DrawContext->Screen, + DrawContext, + DrawContext->GuiContext, + GuiPointerPrimaryDown, + 0, + 0, + PointerState.X, + PointerState.Y + ); + + } + + ObjectHeld = TRUE; + } else { + ObjectHeld = FALSE; } if (HoldObject != NULL) { -- GitLab