瀏覽代碼

Fixes #3729. ProcessContinuousButtonPressedAsync is using a stale MouseEvent. (#3730)

BDisp 10 月之前
父節點
當前提交
40056a6f2c
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

+ 6 - 6
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)
             {