فهرست منبع

Fixes #3729. ProcessContinuousButtonPressedAsync is using a stale MouseEvent.

BDisp 11 ماه پیش
والد
کامیت
bf3e9b2ac1
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)
             {