Browse Source

Ensures a new iteration when _eventReady is already set.

BDisp 9 months ago
parent
commit
a2872cdb9a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

+ 9 - 1
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -2517,7 +2517,15 @@ internal class WindowsMainLoop : IMainLoopDriver
                 }
             }
 
-            _eventReady.Set ();
+            if (_eventReady.IsSet)
+            {
+                // it's already in an iteration and ensures set to iterate again
+                Application.Invoke (() => _eventReady.Set ());
+            }
+            else
+            {
+                _eventReady.Set ();
+            }
         }
     }