From bf3e9b2ac19fc792921bb3766166dfa6c9928fd1 Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 5 Sep 2024 11:57:44 +0100 Subject: [PATCH] Fixes #3729. ProcessContinuousButtonPressedAsync is using a stale MouseEvent. --- Terminal.Gui/ConsoleDrivers/WindowsDriver.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs b/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs index 8fb1d52e8..c0034d6c2 100644 --- a/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs +++ b/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs @@ -1811,12 +1811,6 @@ internal class WindowsDriver : ConsoleDriver int delay = startDelay; while (_isButtonPressed) { - var me = new MouseEvent - { - Position = _pointMove, - Flags = mouseFlag - }; - // TODO: This makes ConsoleDriver dependent on Application, which is not ideal. This should be moved to Application. View view = Application.WantContinuousButtonPressedView; @@ -1831,6 +1825,12 @@ internal class WindowsDriver : ConsoleDriver } await Task.Delay (delay); + var me = new MouseEvent + { + Position = _pointMove, + Flags = mouseFlag + }; + //Debug.WriteLine($"ProcessContinuousButtonPressedAsync: {view}"); if (_isButtonPressed && (mouseFlag & MouseFlags.ReportMousePosition) == 0) {